NYOJ 558 一二三

地址:http://acm.nyist.net/JudgeOnline/problem.php?pid=558

 1 #include<stdio.h>
 2 #include<string.h>
 3 int main()
 4 {
 5     int n,m;
 6     char a[6];
 7     scanf("%d",&n);
 8     while(n--)
 9     {
10         scanf("%s",a); 
11         m=strlen(a);
12         if(m==3)
13         {
14             if((a[0]=='o'&&a[1]=='n')||(a[0]=='o'&&a[2]=='e')||(a[1]=='n'&&a[2]=='e'))
15             printf("1\n");
16             else
17             printf("2\n");
18         }
19         else
20         printf("3\n");
21     }
22     return 0;
23 }

posted on 2012-08-17 10:15  mycapple  阅读(211)  评论(0编辑  收藏  举报

导航