9Google AdSense

12289 One-Two-Three

Problem
#include<stdio.h>
#include<string.h>

int main()
{
    int test,i,l,h,w;
    char str[50];
       // freopen("F:\\a.txt","r",stdin);
        scanf("%d",&test);
        for(i=1;i<=test;i++)
        {
            scanf("%s",str);
            l=strlen(str);
            if(l==3)
            {
                if((str[0]=='o')&&(str[1]=='n')||(str[0]=='o')&&(str[2]=='e')||(str[1]=='n')&&(str[2]=='e'))
                    printf("1\n");
                else if((str[0]=='t')&&(str[1]=='w')||(str[0]=='t')&&(str[2]=='o')||(str[1]=='w')&&(str[2]=='o'))
                    printf("2\n");
        }
        if(l==5)
        printf("3\n");
    }

        return 0;

}


No comments: