Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <cctype>
- using namespace std;
- string getSyl(string Line){
- for(int i=0; i<Line.length(); i++){
- Line[i]=tolower(Line[i]);
- }
- string Syl;
- int P = Line.length()-1;
- while (Line[P]!='a'&&Line[P]!='e'&&Line[P]!='o'&&Line[P]!='u'&&Line[P]!='i'&&Line[P]!=' '&&P!=0){
- Syl += Line[P];
- P--;
- }
- Syl = Syl + Line[P];
- P--;
- //cout<<Syl<<endl;
- return Syl;
- }
- int main() {
- int verses;
- cin >> verses;
- cin.ignore();
- for(int i=0;i<verses;i++){
- string L1;
- getline(cin,L1);
- L1 =getSyl(L1);
- string L2;
- getline(cin,L2);
- L2 = getSyl(L2);
- string L3;
- getline(cin,L3);
- L3 = getSyl(L3);
- string L4;
- getline(cin,L4);
- L4 = getSyl(L4);
- if(L1==L2&&L3==L4&&L1==L3&&L2==L4&&L1==L4&&L2==L3){
- cout<<"perfect"<<endl;
- }else if(L1==L2&&L3==L4&&L1!=L3&&L2!=L4&&L1!=L4&&L2!=L3){
- cout<<"even"<<endl;
- }else if(L1!=L2&&L3!=L4&&L1==L3&&L2==L4&&L1!=L4&&L2!=L3){
- cout<<"cross"<<endl;
- }else if(L1!=L2&&L3!=L4&&L1!=L3&&L2!=L4&&L1==L4&&L2==L3){
- cout<<"shell"<<endl;
- }else{
- cout<<"free"<<endl;
- }
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment