From 9246baf43b6e0ea36f04f9464d56b322cb155e04 Mon Sep 17 00:00:00 2001 From: ShazidMahsrafi Date: Tue, 18 Jul 2023 16:01:06 +0600 Subject: [PATCH] initial commit --- 131A cAPS lOCK/131A.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 131A cAPS lOCK/131A.cpp diff --git a/131A cAPS lOCK/131A.cpp b/131A cAPS lOCK/131A.cpp new file mode 100644 index 0000000..f22c762 --- /dev/null +++ b/131A cAPS lOCK/131A.cpp @@ -0,0 +1,40 @@ +#include +using namespace std; +using ll = long long; + +void solve() +{ + string s; + cin >> s; + bool cap = 1; + for (int i = 1; i < s.size(); ++i) + { + if (islower(s[i])) + { + cap = 0; + break; + } + } + if (cap) + { + for (int i = 0; i < s.size(); ++i) + { + if(islower(s[i])) + s[i]=toupper(s[i]); + else s[i]=tolower(s[i]); + } + } + cout<> TC; + // cin.ignore(); + while (TC--) + solve(); +} \ No newline at end of file