UVa 11233 - Deli Deli
来源:互联网 发布:史上最奇葩的淘宝差评 编辑:程序博客网 时间:2024/05/16 08:55
题目:求所给单词的负数形式。
分析:模拟。直接按章题意分情况求解即可。
说明:按语法也可以(⊙_⊙)。
#include <iostream>#include <cstdlib>#include <cstring>#include <cstdio>using namespace std;char word[22][22],maps[22][22],text[25];int cmp(char *s, char c){for (int i = 0 ; s[i] ; ++ i)if (s[i] == c)return 1;return 0;}int main(){int L,N;while (cin >> L >> N) {for (int i = 0 ; i < L ; ++ i)cin >> word[i] >> maps[i];for (int i = 0 ; i < N ; ++ i) {cin >> text;int flag = 0;for (int j = 0 ; j < L ; ++ j)if (!strcmp(text,word[j])) {cout << maps[j] << endl;flag = 1;break;}if (flag) continue;int end = strlen(text)-1;if (end > 0 && text[end] == 'y' && !cmp("aeiou", text[end-1])) {strcpy(&text[end],"ies");cout << text << endl;}else if (cmp("osx", text[end]))cout << text << "es" << endl;else if (end > 0 && text[end] == 'h' && cmp("cs", text[end-1]))cout << text << "es" << endl;else cout << text << "s" << endl;}}return 0;}
0 0
- UVa 11233 - Deli Deli
- Deli Deli
- HDU 1804 Deli Deli
- poj 3366 Deli Deli
- hdu_1804 Deli Deli
- HDU1804 Deli Deli
- HDU 1804 Deli Deli
- BNUOJ 1010 Deli Deli
- HDU 1804:Deli Deli
- HDU_1804Deli Deli
- 【TOJ 2911】 Deli Deli【水题】
- POJ 3366 Deli Deli 可能会
- 【端午小练】HDU1804-Deli Deli
- HDU——1804 Deli Deli
- [字典树] HDU 1804 - Deli Deli
- 杭电OJ 1803 Deli Deli
- HDU 1804 Deli Deli (String)
- Deli Deli(简单的STL + 字符串)
- 模拟赛 最小乘积路
- 标准的访问控制列表的配置
- LeetCode:Single Number
- android webview中调用了js的时候混淆注意事项
- PSI、TS流总结
- UVa 11233 - Deli Deli
- Android利用reative_layout生成梅花界面
- Unity3D_NGUI 灰度shader
- SQL Server 中关于EXCEPT和INTERSECT的用法
- PSI信息解析
- osgEarth支持中文过程详解
- Learning Vector - UVa 12589 dp
- XMPPFramework
- mac erlang hello world