One-Two-Three
题目连结
three
5个字母one
two
3个字母所以先看测值的size就可以判断了
接下来看1跟2
one
可以换得值如下_ne
o_e
on_
这样去判断如果符合就是1,反之是2
#include<bits/stdc++.h>using namespace std;int main(){ int t; cin>>t; while(t--){ string s; cin>>s; int n = s.size(); if(n==5){ cout<<"3"<<endl; } else if(n==3){ // one two on_ o_e _ne if((s[0]=='o'&&s[2]=='e')||(s[0]=='o'&&s[1]=='n')||(s[1]=='n'&&s[2]=='e')){ cout<<"1"<<endl; } else{ cout<<2<<endl; } } else{ cout<<"fuck"<<endl; } } return 0;}