Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int isCapsOn(string s){
- for(int i = 1; i<s.size(); i++){
- if(islower(s[i])){
- return 0;
- }
- }
- return 1;
- }
- int main(){
- string sinp;
- cin >> sinp;
- if(isCapsOn(sinp)){
- for(int i = 0; i<sinp.size(); i++){
- if( islower(sinp[i]) )
- sinp[i] = toupper(sinp[i]);
- else
- sinp[i] = tolower(sinp[i]);
- }
- cout << sinp << endl;
- }
- else
- cout << sinp << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement