1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
#include <iostream> #include <string> #include <vector> #include <string.h> using namespace std; int main() { int n; string str; cin>>n; while(n--) { cin>>str; if(str.size()==5) { cout<<"3"<<"\n"; continue; } int cnt=0; if(str[0]=='o'|| str[0]=='n' || str[0]=='e') { cnt++; } if((str[1]=='o'|| str[1]=='n' || str[1]=='e') && str[1]!=str[0]) { cnt++; } if((str[2]=='o'|| str[2]=='n' || str[2]=='e') && str[1]!=str[2] && str[2]!=str[0]) { cnt++; } if(cnt>=2) { cout<<"1"<<"\n"; continue; } cnt=0; if(str[0]=='t'|| str[0]=='w' || str[0]=='o') { cnt++; } if((str[1]=='t'|| str[1]=='w' || str[1]=='o') && str[1]!=str[0]) { cnt++; } if((str[2]=='t'|| str[2]=='w' || str[2]=='o')&& str[1]!=str[2] && str[2]!=str[0]) { cnt++; } if(cnt>=2) { cout<<"2"<<"\n"; continue; } } return 0; } |