Advertisement
TwITe

Untitled

Aug 8th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. int task3() {
  2.     char c;
  3.     cin >> c;
  4.     bool is_char_edited = false;
  5.     if (c >= 'a' && c <= 'z') {
  6.         c = c - 'a' + 'A';
  7.         is_char_edited = true;
  8.     }
  9.     if ((c >= 'A' && c <= 'Z') && !is_char_edited) {
  10.         c = c - 'A' + 'a';
  11.     }
  12.     cout << c;
  13.     return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement