Created
September 26, 2017 22:50
-
-
Save AdrianoPereira/9f441f77b30cd8ec0137e6860c7604a3 to your computer and use it in GitHub Desktop.
incopleto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
string solve(string text){ | |
int ant; | |
string ans =""; | |
ant = 0; | |
if(text[0] == 'b'){ | |
ans += "f"; | |
}else if(text[0] == 'B'){ | |
ans += "F"; | |
}else if(text[0] == 'j'){ | |
ans += "f"; | |
}else if(text[0] == 'J'){ | |
ans += "F"; | |
}else if(text[0] == 'p'){ | |
ans += "p"; | |
}else if(text[0] == 'P'){ | |
ans += "F"; | |
}else if(text[0] == 's'){ | |
ans += "f"; | |
}else if(text[0] == 'S'){ | |
ans += "F"; | |
}else if(text[0] == 'v'){ | |
ans += "v"; | |
}else if(text[0] == 'V'){ | |
ans += "F"; | |
}else if(text[0] == 'x'){ | |
ans += "f"; | |
}else if(text[0] == 'X'){ | |
ans += "F"; | |
}else if(text[0] == 'z'){ | |
ans += "z"; | |
}else if(text[0] == 'Z'){ | |
ans += "F"; | |
}else { | |
ans += text[0]; | |
ant = -1; | |
} | |
for(int x=1; x<(int)text.size(); x++){ | |
if(text[x] == 'b'){ | |
if(ant == ()) | |
ans += "f"; | |
}else if(text[x] == 'B'){ | |
if(tolower(text[x]) != tolower(ant)) | |
ans += "F"; | |
}else if(text[x] == 'j'){ | |
if(tolower(text[x]) != tolower(ant)) | |
ans += "f"; | |
}else if(text[x] == 'J'){ | |
if(tolower(text[x]) != tolower(ant)) | |
ans += "F"; | |
}else if(text[x] == 'p'){ | |
if(tolower(text[x]) != tolower(ant)) | |
ans += "f"; | |
}else if(text[x] == 'P'){ | |
if(tolower(text[x]) != tolower(ant)) | |
ans += "F"; | |
}else if(text[x] == 's'){ | |
if(tolower(text[x]) != tolower(ant)) | |
ans += "f"; | |
}else if(text[x] == 'S'){ | |
if(tolower(text[x]) != tolower(ant)) | |
ans += "F"; | |
}else if(text[x] == 'v'){ | |
if(tolower(text[x]) != tolower(ant)) | |
ans += "f"; | |
}else if(text[x] == 'V'){ | |
if(tolower(text[x]) != tolower(ant)) | |
ans += "F"; | |
}else if(text[x] == 'x'){ | |
if(tolower(text[x]) != tolower(ant)) | |
ans += "f"; | |
}else if(text[x] == 'X'){ | |
if(tolower(text[x]) != tolower(ant)) | |
ans += "F"; | |
}else if(text[x] == 'z'){ | |
if(tolower(text[x]) != tolower(ant)) | |
ans += "f"; | |
}else if(text[x] == 'Z'){ | |
if(tolower(text[x]) != tolower(ant)) | |
ans += "F"; | |
}else { | |
ans += text[x]; | |
ant = -1; | |
} | |
} | |
return ans; | |
} | |
int main(){ | |
#ifndef ONLINE_JUDGE | |
freopen("input.txt", "r", stdin); | |
// freopen("input2.txt", "r", stdin); | |
// freopen("output.sol", "w", stdout); | |
#endif | |
string text; | |
bool space = false; | |
while(getline(cin, text)){ | |
if(space) cout << endl; | |
else space = true; | |
cout << solve(text) << endl; | |
getline(cin, text); | |
cout << solve(text) << endl; | |
getline(cin, text); | |
cout << solve(text) << endl; | |
getline(cin, text); | |
cout << solve(text) << endl; | |
// cout << endl; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment