Problem H: 零起点学算法109——单数变复数
#include <stdio.h>
#include<string.h>
int main(void)
{
int n;
char word[];
scanf("%d",&n);
getchar();
int i;
while(n!=)
{
gets(word);
int k=strlen(word);
if(word[k-]=='y')
strcat(word,"es");
else if(word[k-]=='s'||word[k-]=='x')
strcat(word,"es");
else if(word[k-]=='s'&&word[k-]=='h')
strcat(word,"es");
else if(word[k-]=='c'&&word[k-]=='h')
strcat(word,"es");
else if(word[k-]=='o')
strcat(word,"es");
else
strcat(word,"s");
puts(word);
n--;
}
return ;
}
似乎用printf提交ac不了,用put可以
Problem H: 零起点学算法109——单数变复数的更多相关文章
- Problem H: 零起点学算法103——查找最大元素
#include<stdio.h> #include<string.h> int main() { ]; while(gets(a)!=NULL) { ]; ;a[i]!='\ ...
- Problem H: 零起点学算法87——打印所有低于平均分的分数
#include<stdio.h> int main(){ ],b[]; while(scanf("%d",&n)!=EOF){ ; ;i<n;i++){ ...
- Problem H: 零起点学算法28——参加程序设计竞赛
#include<stdio.h> int main() { int a,b; while(scanf("%d %d",&a,&b)!=EOF) ||b ...
- Problem G: 零起点学算法106——首字母变大写
#include<stdio.h> #include<string.h> int main(void) { ]; int i,k; while(gets(a)!=NULL) { ...
- Problem D: 零起点学算法95——弓型矩阵
#include<stdio.h> #include<string.h> int main() { ][]; while(scanf("%d%d",& ...
- Problem F: 零起点学算法42——多组测试数据输出II
#include<stdio.h> int main() { ; while(scanf("%d%d%d",&a,&b,&c)!=EOF) { ...
- Problem E: 零起点学算法34——3n+1问题
#include<stdio.h> #include<math.h> int main() { int n; n<=pow(,); ; scanf("%d&qu ...
- Problem K: 零起点学算法107——统计元音
#include<stdio.h> int main() { int n; ]; while(scanf("%d%*c",&n)!=EOF) { while(n ...
- Problem J: 零起点学算法105——C语言合法标识符
#include<stdio.h> #include<ctype.h>//调用isalpha函数 int main() { int n; ]; while(scanf(&quo ...
随机推荐
- 关于tcp连接对象在多进程中的错误:pickle.PicklingError
如果需要在多进程中使用tcp连接的对象,那么不能再主进程中将这个对象创建好当做参数传给子进程,因为在创建子进程是需要序列化对象,然而socket对象是不能序列化的,会产生一个pickle.Pickli ...
- 内核抢占实现(preempt) 【转】
转自:http://blog.chinaunix.net/uid-12461657-id-3353217.html 一.什么叫抢占所谓抢占,说白了就是进程切换.linux的用户空间,进程A在执行中,来 ...
- 64_l6
lightdm-qt5-devel-1.22.0-1.fc26.i686.rpm 19-May-2017 11:11 22854 lightdm-qt5-devel-1.22.0-1.fc26.x86 ...
- 64_l3
libguac-client-ssh-0.9.13-3.20170521git6d2cfda...> 23-May-2017 09:58 64570 libguac-client-ssh-0.9 ...
- 64_a2
arquillian-core-parent-1.1.11-6.fc26.noarch.rpm 10-Feb-2017 13:22 12918 arquillian-core-spi-1.1.11-6 ...
- OpenRCT2-ext
https://github.com/RollingStar/RCT-Music-Patch https://github.com/seanfisk/rct2-game-objects https:/ ...
- 1438. Shopaholic
Constraints Time Limit: 1 secs, Memory Limit: 32 MB Description Lindsay is a shopaholic. Whenever th ...
- ASPxCheckBoxList控件获取selected项的text和value的方法
设ASPxCheckBoxList的ClientInstanceName为list_ var needtext; for (var i = 0; i < list_.GetSelectedIte ...
- C语言比较巧妙的字符串分割程序
在解析字符串时,能够解析的给出每个字符串的长度.内容.以及每个字符串的第一个字符的地址. short i; ; //切割之后的字符串的个数 ,ItemLen[],Idx[], ThCommandLen ...
- C++11——Use auto keyword in C++11
版权声明:本文系原创,转载请注明来源. Compile your program with: g++ -std=c++ -o target_name filen_ame.cpp or: g++ -st ...