Advertisement
SelinD

35

Jun 21st, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #include<iostream>
  2. #include<cstring>
  3. using namespace std;
  4.  
  5. void trans(char &c)
  6. {
  7. if(c>='a' && c<='z') c=tolower(c);
  8. if(c<='A' && c<='Z') c=toupper(c);
  9. }
  10.  
  11. int main()
  12. {
  13. char s[100];
  14. int i;
  15. cin.getline(s,100);
  16. for(i=0;i<strlen(s);i++)
  17. {
  18. trans(s[i]);
  19. }
  20. cout<<s;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement