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 ...
随机推荐
- javascript性能
1.js文件放在底部 js文件具有阻塞机制,放在头部,需要等待js下载解析完毕之后才能下载渲染页面,因此需要放在底部
- 中断中处理延时及一些函数的调用规则(中断调i2c驱动有感)--中断中的延迟delay与printk函数的冲突【转】
转自:http://blog.csdn.net/psvoldemort/article/details/8222371 1,中断处理程序中不能使用有睡眠功能的函数,如ioremap,kmalloc,m ...
- 【hihocoder】sam-2
原意是把sam那一堆做完…… 这题还是很sb的,$\sum{maxlen(s)-minlen(s)+1}$就是本质不同的子串数量 然后因为suffix link的性质,maxlen[fa[s]]=mi ...
- jQuery 选中tr下面的第某个td
1.问题描述 点击 table 中的某行 tr,获取该 tr 下的第一个 td 标签下的< input type="hidden" value="92"/ ...
- 修改mysql权限
关于mysql的用户管理,笔记 1.创建新用户 通过root用户登录之后创建 >> grant all privileges on *.* to testuser@localhost id ...
- FineReport——弹出新窗体选值并回调
主要实现的功能: 在主页面,通过单击按钮,弹出窗体,在窗体中通过下拉框选择值并查询,如果是多值,可以通过复选框选择,点击确定,将选中的行的字段值传递给主页面的下拉复选框,定义其编辑后事件进行查询.将想 ...
- 算法入门系列1:k-means
k-means是一种无监督学习算法,用于聚类. 下图(来自http://www.cnblogs.com/jerrylead/archive/2011/04/06/2006910.html)展示了k-m ...
- beego学习笔记(1)
公司准备开发一个针对塔吊行业的APP. 后台采用微服务,docker容器部署. 准备采用go进行微服务的开发. 采用beego进行restful API的开发. 第一步,访问beego的官方网站: h ...
- Restore IP Addresses——边界条件判定
Given a string containing only digits, restore it by returning all possible valid IP address combina ...
- Python图像处理库(2)
1.4 SciPy SciPy(http://scipy.org/) 是建立在 NumPy 基础上,用于数值运算的开源工具包.SciPy 提供很多高效的操作,可以实现数值积分.优化.统计.信号处理,以 ...