restructured

This commit is contained in:
nihonium 2022-10-22 18:26:37 +03:00
parent c495b7c47f
commit 66cefdfd63
Signed by: nihonium
GPG key ID: 0251623741027CFC
204 changed files with 538 additions and 13662 deletions

View file

@ -0,0 +1,22 @@
#include <iostream>
#include <string>
#include <cctype>
using namespace std;
string letter_case_switch(const string & str)
{
string result = str;
if (str.size() == 0)
return result;
result[0] =
isupper(result[0]) ? tolower(result[0]) : toupper(result[0]);
return result;
}
int main()
{
string meow;
cin >> meow;
cout << letter_case_switch(meow) << endl;
}

View file

@ -0,0 +1,19 @@
#include <iostream>
#include <string>
#include <cctype>
using namespace std;
string letter_case_switch(const string& str) {
string result = str;
if (str.size() == 0)
return result;
result[0] = isupper(result[0]) ? tolower(result[0]) : toupper(result[0]);
return result;
}
int main() {
string meow;
cin >> meow;
cout << letter_case_switch(meow) << endl;
}