NYOJ558 一二三
来源:互联网 发布:ubuntu如何运行py文件 编辑:程序博客网 时间:2024/04/27 20:37
原题链接
这题很简单,但是做得我想哭%>_<%,都是因为没看懂题意,错了三次,没想到小孩还有写正确的情况。题意啊题意...
#include <cstdio>#include <cstring>char *a[] = {"one", "two", "three"}, str[6];int cmp(char s[]){int count = 0, len = strlen(str);for(int i = 0; i != len; ++i)if(s[i] != str[i]) ++count;return count;}int main(){int t, i, x;scanf("%d", &t);while(t-- && scanf("%s", str))for(i = 0; i != 3; ++i)if((x = cmp(a[i])) == 1 || x == 0){printf("%d\n", i + 1);break;}return 0;}
0 0
- NYOJ558 一二三
- (一二三)
- 一二三
- 一二三
- 一二三
- 一二三
- 一二三
- 一二三
- 一二三
- 一二三
- debug经验一二三
- Static 一二三
- debug经验一二三
- Enough用法一二三
- 数据库邮件一二三
- Analysis Services一二三
- 全文索引一二三
- 南邮一二三
- Hibernate Annotation (Hibernate 注解实例)
- ftp服务器
- uva 10382 Watering Grass_贪心
- Android自定义控件实现及其布局
- 英雄会15题 阶乘与整除
- NYOJ558 一二三
- Srtuts2实现登录界面(不连接数据库)
- 与师兄交流后的感想
- andorid 百度地图api 使用
- 利用NS2的产生随机数机制来实现对链路的动态设置(连接建立时间,延迟)
- 移动开发者必须了解的10大跨平台工具
- ZOJ 2864 Catch the thief
- 最短路径算法
- 充电方式真的能决定手机充电量吗?USB充电和直充效果不同?