Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Codeforces Round 131A
- #include <string>
- #include <iostream>
- using namespace std;
- int main()
- {
- int len, c=1;
- string s;
- cin >> s;
- len = s.size();
- for(int i=1;i<len;i++)
- {
- if(s[i]>=97&&s[i]<=122)
- {
- c=0;
- }
- }
- if(c==0)
- {
- cout<<s;
- }
- else
- {
- if(s[0]>=97&&s[0]<=122)
- {
- s[0]-=32;
- }
- else
- {
- s[0]+=32;
- }
- for(int i=1;i<s.length();i++)
- {
- s[i]+=32;
- }
- cout<<s;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement