Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- string str;
- cin>>str;
- bool pustenCapsLock=true;
- for(int i=1;i<str.size();++i)
- if(str[i]>='a')
- {
- pustenCapsLock=false;
- }
- if(pustenCapsLock)
- for(int i=0;i<str.size();++i)
- {
- if(str[i]>='A' && str[i]<='Z')
- str[i]+=32;
- else
- str[i]-=32;
- }
- cout<<str;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement