-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUva12289.cpp
More file actions
36 lines (32 loc) · 939 Bytes
/
Copy pathUva12289.cpp
File metadata and controls
36 lines (32 loc) · 939 Bytes
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
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <algorithm>
using namespace std;
int main()
{
int num;
scanf("%d",&num);
string word;
while(num--){
cin>>word;
if(word.size()>3){
cout<<"3"<<endl;
}
else{
if(word[0]=='o' && word[1]=='n' && word[2]=='e')cout<<"1"<<endl;
else if(word[0]=='o' && word[1]=='n')cout<<"1"<<endl;
else if(word[0]=='o' && word[2]=='e')cout<<"1"<<endl;
else if(word[1]=='n' && word[2]=='e')cout<<"1"<<endl;
else if(word[0]=='t' && word[1]=='w' && word[2]=='o')cout<<"2"<<endl;
else if(word[0]=='t' && word[1]=='w')cout<<"2"<<endl;
else if(word[0]=='t' && word[2]=='o')cout<<"2"<<endl;
else if(word[1]=='w' && word[2]=='o')cout<<"2"<<endl;
}
}
return 0;
}