fork download
  1. #include <bits/stdc++.h>
  2. using namespace std ;
  3. void play()
  4. {
  5. ios::sync_with_stdio(0);
  6. cin.tie(0);
  7. cout.tie(0);
  8. }
  9. typedef vector<int> vi;
  10. typedef vector<long long> vl;
  11. typedef vector<char> vc;
  12. typedef long long ll;
  13. typedef map<long long , long long> mpl;
  14. typedef map<string , long long> mpsl;
  15. typedef map<long long , string> mpls;
  16. typedef map<char , long long> mpcl;
  17. typedef map<long long , char> mplc;
  18.  
  19. ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
  20. int lcd(long long a,long long b)
  21. {
  22. return abs((a*b/gcd(a,b)));
  23.  
  24. }
  25. int convertBinToDe(long long n)
  26. {
  27. int deNum = 0, i = 0, rem;
  28. while (n!=0)
  29. {
  30. rem = n%10;
  31. n /= 10;
  32. deNum += rem*pow(2,i);
  33. ++i;
  34. }
  35. return deNum;
  36. }
  37.  
  38. void convertDeToBin(int n)
  39. {
  40. ll rem[100],i=0,j,c=0;
  41.  
  42.  
  43. while(n>0)
  44. {
  45. rem[i]=n%2;
  46. i++;
  47. n=n/2;
  48. }
  49. bool t=true;
  50. while(t==true)
  51. {
  52. if(rem[c]==0){c++;}
  53. else{t=false;}
  54. }
  55. for(j=i-1;j>=c;j--)
  56. {
  57. cout<<rem[j];
  58. }
  59. }
  60.  
  61. int main ()
  62. {
  63. play();
  64.  
  65. string s="";
  66.  
  67.  
  68. while(s!="DONE")
  69. {
  70. mpcl mp;
  71. string s;
  72.  
  73. getline(cin,s);
  74. if(s=="DONE"){break;}
  75.  
  76. for(int i=0;i<s.size();i++)
  77. {
  78. if(s[i]>='A'&&s[i]<='Z'){s[i]+=32;}
  79. if(s[i]>='a'&&s[i]<='z'){mp[s[i]]++;}
  80. }
  81. mpcl::iterator it=mp.begin();
  82. ll c=0;
  83. while(it!=mp.end())
  84. {
  85. if(it->second%2!=0){c++;}
  86. it++;
  87. }
  88. //cin.ignore (std::numeric_limits<std::streamsize>::max(), '\n');
  89. if(c>=2){cout<<"Uh oh..\n";}
  90. else {cout<<"You won't be eaten!\n";}
  91.  
  92. }
  93.  
  94. return 0;
  95. }
  96.  
Success #stdin #stdout 0s 15240KB
stdin
aabbccdd
DONE
stdout
You won't be eaten!