TOPIC

10% wrong answer....what is the error?

MD Faizul Abedin Shibli asked 3 years ago

include include

using namespace std; int main() {

char a[5];
int n,i;
cin>>n;
while(n--)
{
    cin>>a;
    if(strlen(a)==3)
    {
        if(a[0]=='o' || a[1]=='n' || a[2]=='e')
            cout<<1<<endl;
            else if(a[0]=='t' ||a[1]=='w' || a[2]=='o')
                cout<<2<<endl;
    }
    else if(strlen(a)==5)
    {
        if(a[0]=='t' || a[1]=='h' || a[2]=='r' || a[3]=='e' || a[4]=='e')
            cout<<3<<endl;
    }
}

}

This topic has not been answered yet. Be the first!

Remember not post solutions. Your post may be reviewed by our moderators.