Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- using namespace std;
- const int XL = 100;
- int main()
- {
- int n; cin >> n;
- char a[XL];
- cin >> a;
- int x = a[0];
- int y = a[1];
- if(x >= 'A' && x <= 'Z')
- {
- if (y >= 'A' && y <= 'Z')
- {
- for(int i = 0; i < n; i++)
- {
- a[i] = a[i] + 32;
- }
- return 0;
- }
- else
- {
- cout << a;
- return 0;
- }
- }
- else if (x >= 'a' && x <= 'z')
- {
- a[0] = a[0]-32;
- if (y >= 'A' && y <= 'Z')
- {
- for(int i = 1; i < n; i++)
- {
- a[i] = a[i]+32;
- }
- }
- }
- for(int i = 0; i < n; i++)
- cout << a[i];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement