一二三
来源:互联网 发布:windows ime下载 编辑:程序博客网 时间:2024/04/27 09:46
切切水题抚慰受伤的心=~=
1250: 一二三
Time Limit: 1 Sec Memory Limit: 128 MB
[Submit][Status][Web Board]
Problem Description
你弟弟刚刚学会写英语的一(one)、二(two)和三(three)。他在纸上写了好些一二三,可惜有些字母写错了。已知每个单词最多有一个字母写错了(单词长度肯定不会错),你能认出他写的啥吗?
Input
第一行为单词的个数(不超过10)。以下每行为一个单词,单词长度正确,且最多有一个字母写错。所有字母都是小写的。
Output
对于每组测试数据,输出一行,即该单词的阿拉伯数字。输入保证只有一种理解方式。
Sample Input
3owetootheee
Sample Output
123
HINT
Source
湖南省第七届大学生程序设计大赛
Difficulty
Author
admin
#include <stdio.h>#include <string.h>#include <iostream>#include <math.h>#include <algorithm>#include <vector>#include <map>#include <queue>#include <stack>#define PI acos(-1.0)#define eps 1e-8#define LL long long#define moo 31536000#define INF 1e9#define maxn 100010using namespace std;char s[100];char one[4]="one",two[4]="two";int ans1,ans2;int main(){ int n; while(~scanf("%d",&n) && n) { ans1=ans2=0; scanf("%s",s); int len=strlen(s); if(len==5) printf("3\n"); else { for(int i=0;i<=2;i++) { if(s[i]==one[i]) ans1++; if(s[i]==two[i]) ans2++; } if(ans1>ans2) printf("1\n"); else printf("2\n"); } } return 0;} /************************************************************** Problem: 1250 User: mangogo Language: C++ Result: Accepted Time:0 ms Memory:1436 kb****************************************************************/
0 0
- (一二三)
- 一二三
- 一二三
- 一二三
- 一二三
- 一二三
- 一二三
- 一二三
- 一二三
- debug经验一二三
- Static 一二三
- debug经验一二三
- Enough用法一二三
- 数据库邮件一二三
- Analysis Services一二三
- 全文索引一二三
- 南邮一二三
- 老子一二三
- 数据运算的习题
- HT for Web基于HTML5的图像操作(一)
- centos6.4下搭建zabbix2.0.6
- 高度图地形读取与漫游
- python之bt种子,dht网络共享热门资源
- 一二三
- 第三章 栈和队列
- 你必须非常努力,才能看起来毫不费力
- tomcat6.0
- 【UML】建模语言
- 细说linux IPC(六):pipe和FIFO
- PyQt+matplotlib界面简单实现
- java web中配置Filter解决jsp中文乱码问题
- 【DFS|暴力】USACO-cha1-sec1.3 Wormholes