forked from kothariji/competitive-programming
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path(CODEFORCES)cAPS_lOCK.cpp
60 lines (55 loc) · 1.04 KB
/
(CODEFORCES)cAPS_lOCK.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define loop(a, b, c) for (int i = a; i < b; i += c)
#define tc \
long long t; \
cin >> t; \
while (t--)
#define fast std::ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
#define print(x) cout << x << nline
const int N = 1e6 + 1;
#define mod 1000000007
void solve()
{
string s;
cin >> s;
string t = s;
int a = 0;
for (int i = 0; i < s.length(); i++)
{
if (s[i] >= 'A' and s[i] <= 'Z')
{
a++;
}
}
if (a == s.length())
{
for (int i = 0; i < s.length(); i++)
{
s[i] += 32;
}
}
else if (a == s.length() - 1)
{
if (s[0] >= 'a' and s[0] <= 'z')
{
s[0] -= 32;
for (int i = 1; i < s.length(); i++)
{
s[i] += 32;
}
}
}
cout<<s<<"\n";
}
signed main()
{
fast;
// tc
{
solve();
}
}
// cAPSlOCK --> no change