Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits\stdc++.h>
- using namespace std;
- int main()
- {
- ios_base::sync_with_stdio(false);
- cin.tie(NULL);
- string str1("po");
- string str2("desu");
- string str3("masu");
- string str5("mnida");
- string str4;
- int t;
- cin>>t;
- while(t--)
- {
- cin>>str4;
- int l=str4.length();
- if(str4==str1)
- cout<<"FILIPINO"<<endl;
- else if(str4==str2 || str4==str3)
- cout<<"JAPANESE"<<endl;
- else if(str4==str5)
- cout<<"KOREAN"<<endl;
- else if (str4.find(str1,l-3) != string::npos)
- cout << "FILIPINO" << endl;
- else if (str4.find(str2,l-5) != string::npos || str4.find(str3,l-5) != string::npos)
- cout << "JAPANESE" << endl;
- else if (str4.find(str5,l-6) != string::npos)
- cout << "KOREAN" << endl;
- else
- continue;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement