Advertisement
muntasir1903110

Untitled

Apr 7th, 2020
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. #include<bits\stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     ios_base::sync_with_stdio(false);
  7.     cin.tie(NULL);
  8.     string str1("po");
  9.     string str2("desu");
  10.     string str3("masu");
  11.     string str5("mnida");
  12.     string str4;
  13.    
  14.    
  15.     int t;
  16.     cin>>t;
  17.     while(t--)
  18.     {
  19.         cin>>str4;
  20.         int l=str4.length();
  21.         if(str4==str1)
  22.         cout<<"FILIPINO"<<endl;
  23.         else if(str4==str2 || str4==str3)
  24.         cout<<"JAPANESE"<<endl;
  25.         else if(str4==str5)
  26.         cout<<"KOREAN"<<endl;
  27.         else if (str4.find(str1,l-3) != string::npos)
  28.         cout << "FILIPINO" << endl;
  29.    
  30.         else if (str4.find(str2,l-5) != string::npos || str4.find(str3,l-5) != string::npos)
  31.         cout << "JAPANESE" << endl;
  32.        
  33.         else if (str4.find(str5,l-6) != string::npos)
  34.         cout << "KOREAN" << endl;
  35.         else
  36.         continue;
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement