Subscribe Us

Responsive Advertisement

Advertisement

URI Online Judge | 1332 One-Two-Three solution in cpp

 

uri 1332 solution in cpp

by ujjal roy




#include<bits/stdc++.h>

using namespace std;

main()

{

    int n;

    cin>>n;

    while(n--)

    {

        string s;

        cin>>s;

        int l=s.size();

        if(l==5) cout<<"3"<<endl;

        else

        {

            if((s[0]=='o'&&s[1]=='n')||(s[0]=='o'&&s[2]=='e')||(s[2]=='e'&&s[1]=='n')) cout<<"1"<<endl;

            else cout<<"2"<<endl;

        }

    }


    return 0;

}


Post a Comment

0 Comments