Advertisement
Rakibul_Ahasan

Uva->12289 - One-Two-Three

Oct 10th, 2019
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. /***
  2. **     Author: Rakibul Ahasan Papon
  3. **     Bangladesh University of Business and Technology,
  4. **     Dept. of CSE.
  5. ***/
  6.  
  7. #include<bits/stdc++.h>
  8. using namespace std;
  9. int main()
  10. {
  11.     string S;
  12.     int n;
  13.     cin>>n;
  14.     while(n--)
  15.     {
  16.         cin>>S;
  17.  
  18.         if((S[0]=='o' && S[1]=='n') || (S[0]=='o' && S[2]=='e') || (S[1]=='n' && S[2]=='e'))
  19.         {
  20.             cout<<"1"<<endl;
  21.         }
  22.         else if((S[0]=='t' && S[1]=='w') || (S[0]=='t' && S[2]=='o') || (S[1]=='w' && S[2]=='o'))
  23.             cout<<"2"<<endl;
  24.         else
  25.             cout<<"3"<<endl;
  26.     }
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement