2013年11月10日 星期日

[UVA] 11289 - One-Two-Three


#include<stdio.h>
#include<string.h>
char s[10];
int main(){
    int t,n=0;
    scanf("%d",&t);
    while(t--){
        scanf("%s",s);
        if(strlen(s)==5) puts("3");
        else{
            n=0;
            if(s[0]=='o') n++;
            if(s[1]=='n') n++;
            if(s[2]=='e') n++;
            if(n>=2) puts("1");
            else puts("2");
        }
    }
}

沒有留言:

張貼留言