题意:将规则动词化为复数形式,将不规则动词化为对应的复数形式,不规则动词的复数形式给出。

解题思路:用map将不规则动词映射成一张表,详见代码。

Code:

#include <iostream>
#include <cstdio>
#include <string>
#include <map>
using namespace std;map<string,string> vis;
int isok(char a)
{char array[6] = {'a','e','i','o','u'};for(int i = 0; i < 5; i++)if(array[i] == a) return 0;return 1;
}
int main()
{//freopen("input.txt","r",stdin);int L,N;string str1,str2;scanf("%d%d",&L,&N);for(int i = 0; i < L; i++){cin>>str1>>str2;vis[str1] = str2;}map<string,string>::iterator it;for(int j = 0; j < N; j++){cin>>str1;it = vis.find(str1);if(it != vis.end()) cout<<it->second<<endl;else if(str1.length()>1 && str1[str1.length()-1] == 'y' && isok(str1[str1.length()-2])){for(int k = 0; k<str1.length()-1; k++)printf("%c",str1[k]);printf("ies\n");}else if(str1[str1.length()-1] == 'o' ||str1[str1.length()-1] == 's'||str1[str1.length()-1] == 'x'||(str1[str1.length()-2] == 'c'&&str1[str1.length()-1] == 'h')||(str1[str1.length()-2] == 's'&&str1[str1.length()-1] == 'h')){cout<<str1<<"es"<<endl;}else{cout<<str1<<"s"<<endl;}}return 0;
}

HDU——1804 Deli Deli相关推荐

  1. HDOJ/HDU 1804 Deli Deli(英语单词复数形式~)

    Problem Description Mrs. Deli is running the delicatessen store "Deli Deli". Last year Mrs ...

  2. UVA11233 POJ3366 HDU1804 Deli Deli【水题】

    Deli Deli Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Sub ...

  3. Deli Deli(https://acs.jxnu.edu.cn/problem/HDU1804)

    2022寒假翻译17 熟食店 1000 ms 32768 k 描述: Deli太太经营一家熟食店"Deli Deli".去年,德里太太决定扩大她的生意,建立一个网上商店.她聘请了一 ...

  4. Deli Deli(模拟,map容器)

    Problem Description Mrs. Deli is running the delicatessen store "Deli Deli". Last year Mrs ...

  5. HDU 1804 Deli Deli

    题目链接:Click here~~ 水水的字符串处理.主要练习下map的用法. 不过这道题,让我一下就想起了初中刚学英语的时候,各种怀念啊. 题意: 输出单词的复数形式.有些是特殊变换的,它事先给你. ...

  6. HDU 1804 Deli Deli (String)

    模拟题,顺便联系一下几个函数 #include<iostream> #include<cstdio> #include<cstring> #include<c ...

  7. hdu_1804 Deli Deli

    原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1804 有中文意思的:http://acm.bnu.edu.cn/v3/problem_show.php ...

  8. BNUOJ 1010 Deli Deli

    由于项目和学习等原因,HK同学最近经常到一些外国文献.结果,他发现,懒惰而且甚至略微有点愚蠢的部分外国编辑居然连英语单词的单数形式变复数形式都处理不好(- -!这个是事实)--这让思维一贯严谨的HK同 ...

  9. UVa 11233 - Deli Deli

    题目:求所给单词的负数形式. 分析:模拟. 直接按章题意分情况求解就可以. 说明:按语法也能够(⊙_⊙). #include <iostream> #include <cstdlib ...

最新文章

  1. DataTable中数据记录的统计
  2. 多迪人事主管揭秘:面试官是如何面试Web前端求职者?
  3. python 图像频谱
  4. 活久见的设备连接故障
  5. 遗传算法解决TSP问题 Python实现【160行以内代码】
  6. 【转】Java类成员变量默认初始化规则
  7. SAP UI5的表格里如何显示复合列
  8. oracle为空替换为0_详解Oracle如何用Translate来统计字符出现的次数
  9. javascript --- Object.create的阅读
  10. easyui datatable ajax 加载数据,ASP.NET easyUI--datagrid 通过ajax请求ASP.NET后台数据的分页查询...
  11. mysql infobright 缺点_infobright、mongodb优劣以及适用范围
  12. linux系统教程vi命令详解,Linux操作系统vi命令详解及其使用技巧
  13. jQuery入口函数的写法
  14. python,执行pip报错:Fatal error in launcher: Unable to create process using ‘“D:\tools\python.exe“ (已解决)
  15. linux nfs不在同一个网络,NFS共享机制
  16. photoshop序列号问题
  17. Tesseract-OCR -01-Tesseract 介绍
  18. 升级版飞机大战来袭,手把手教学,万字详解,你还学不会嘛?
  19. 一个0中间一斜杠_斜杠青年喜欢的“网红台灯”:会唱歌,能无线充电,抖音获赞16W+...
  20. 如何彻底禁止易升更新Win10自动更新

热门文章

  1. ST电机库v5.4.4源代码分析(8): 旋编怎么对齐
  2. 什么是精灵图?如何使用精灵图。
  3. tensorflow quene queueRunner
  4. 使用MitmProxy离线缓存360度全景网页
  5. 莫言谈山东故乡:泥塑剪纸茂腔伴其成长-文学奖-莫言-诺贝尔奖
  6. 笔记本网络重置后没有WIFI图标
  7. fastadmin 时间选择框
  8. JavaScript基础之 caller和callee
  9. 中断与其他函数共享变量、临界资源的保护
  10. 临界资源与临界区(十)