Laitofai

4

May 5th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. //#4
  2. #include <iostream>
  3. #include <cstring>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     char str[50];
  10.     cin.getline(str, 50);
  11.     for(int i = 0; i < strlen(str); i++){
  12.         if(islower(str[i])){
  13.             str[i] = toupper(str[i]);
  14.         }else if(isupper(str[i])){
  15.             str[i] = tolower(str[i]);
  16.         }
  17.     }
  18.     for(int i = 0; i < strlen(str); i++){
  19.         cout << str[i];
  20.     }
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment