fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4. #include <string>
  5. using namespace std;
  6.  
  7. int main() {
  8. string str,t="DONE";
  9.  
  10. int q,size;
  11. char s;
  12.  
  13. while(getline (cin,str)&&str!="DONE")
  14. { str.erase(remove( str.begin(), str.end(), '.' ), str.end());
  15. str.erase(remove( str.begin(), str.end(), ',' ), str.end());
  16. str.erase(remove( str.begin(), str.end(), '!' ), str.end());
  17. str.erase(remove( str.begin(), str.end(), '?' ), str.end());
  18. str.erase(remove( str.begin(), str.end(), ' ' ), str.end());
  19. transform(str.begin(), str.end(), str.begin(),::toupper);
  20.  
  21. if (str == string(str.rbegin(), str.rend()))
  22. cout<<"You won't be eaten!"<<'\n';
  23. else
  24. cout<<"Uh oh.."<<'\n';
  25.  
  26.  
  27.  
  28. }
  29. return 0;
  30. }
  31.  
Success #stdin #stdout 0s 3420KB
stdin
Madam, Im adam!
Roma tibi subito motibus ibit amor.
Me so hungry!
Si nummi immunis
DONE
stdout
You won't be eaten!
You won't be eaten!
Uh oh..
You won't be eaten!