Advertisement
rengetsu

Codeforces_131A

Jul 25th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. //Codeforces Round 131A
  2. #include <string>
  3. #include <iostream>
  4. using namespace std;
  5. int main()
  6. {
  7.     int len, c=1;
  8.     string s;
  9.     cin >> s;
  10.     len = s.size();
  11.     for(int i=1;i<len;i++)
  12.     {
  13.         if(s[i]>=97&&s[i]<=122)
  14.         {
  15.             c=0;
  16.         }
  17.     }
  18.     if(c==0)
  19.     {
  20.         cout<<s;
  21.     }
  22.     else
  23.     {
  24.         if(s[0]>=97&&s[0]<=122)
  25.         {
  26.             s[0]-=32;
  27.         }
  28.         else
  29.         {
  30.             s[0]+=32;
  31.         }
  32.         for(int i=1;i<s.length();i++)
  33.         {
  34.             s[i]+=32;
  35.         }
  36.         cout<<s;
  37.     }
  38.     return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement