diff options
| author | Omar Magdy <omar.professional8777@gmail.com> | 2022-06-25 18:32:00 +0200 |
|---|---|---|
| committer | Omar Magdy <omar.professional8777@gmail.com> | 2022-06-25 18:32:00 +0200 |
| commit | 7c3f32fab3b1a9d628d6856e7a923eb3c3b1ce5f (patch) | |
| tree | 484c58be6bc4ceadf35010ed8b81854994903503 /Word | |
| parent | a0a07a438b6804fdca0e18b2d626ceedb982611c (diff) | |
| download | competitive-programming-7c3f32fab3b1a9d628d6856e7a923eb3c3b1ce5f.tar.xz competitive-programming-7c3f32fab3b1a9d628d6856e7a923eb3c3b1ce5f.zip | |
Solved a couple of problems from codechef and codeforces
Diffstat (limited to 'Word')
| -rw-r--r-- | Word/inp | 0 | ||||
| -rwxr-xr-x | Word/main | bin | 0 -> 24328 bytes | |||
| -rw-r--r-- | Word/main.cpp | 34 | ||||
| -rw-r--r-- | Word/main_input0.txt | 1 | ||||
| -rw-r--r-- | Word/main_input1.txt | 1 | ||||
| -rw-r--r-- | Word/main_input2.txt | 1 | ||||
| -rw-r--r-- | Word/main_output0.txt | 1 | ||||
| -rw-r--r-- | Word/main_output1.txt | 1 | ||||
| -rw-r--r-- | Word/main_output2.txt | 1 |
9 files changed, 40 insertions, 0 deletions
diff --git a/Word/inp b/Word/inp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Word/inp diff --git a/Word/main b/Word/main Binary files differnew file mode 100755 index 0000000..01dfeb5 --- /dev/null +++ b/Word/main diff --git a/Word/main.cpp b/Word/main.cpp new file mode 100644 index 0000000..31937b2 --- /dev/null +++ b/Word/main.cpp @@ -0,0 +1,34 @@ +#include<bits/stdc++.h> +#include <cctype> + +using namespace std; + +string convertLower(string s) { + for(auto &ch : s) { + ch = tolower(ch); + } + return s; +} +string convertUpper(string s) { + for(auto &ch : s) { + ch = toupper(ch); + } + return s; +} + +int main () { + ios_base::sync_with_stdio(false); + cin.tie(NULL); + string s; + cin >> s; + int l = 0; + int u = 0; + for(auto ch : s) { + if(islower(ch)) { + l++; + } else { + u++; + } + } + cout << (l < u ? convertUpper(s) : convertLower(s)); +} diff --git a/Word/main_input0.txt b/Word/main_input0.txt new file mode 100644 index 0000000..dcf8e7c --- /dev/null +++ b/Word/main_input0.txt @@ -0,0 +1 @@ +HoUse diff --git a/Word/main_input1.txt b/Word/main_input1.txt new file mode 100644 index 0000000..619b51b --- /dev/null +++ b/Word/main_input1.txt @@ -0,0 +1 @@ +ViP diff --git a/Word/main_input2.txt b/Word/main_input2.txt new file mode 100644 index 0000000..b6751f3 --- /dev/null +++ b/Word/main_input2.txt @@ -0,0 +1 @@ +maTRIx diff --git a/Word/main_output0.txt b/Word/main_output0.txt new file mode 100644 index 0000000..90dde25 --- /dev/null +++ b/Word/main_output0.txt @@ -0,0 +1 @@ +house diff --git a/Word/main_output1.txt b/Word/main_output1.txt new file mode 100644 index 0000000..7077ce5 --- /dev/null +++ b/Word/main_output1.txt @@ -0,0 +1 @@ +VIP diff --git a/Word/main_output2.txt b/Word/main_output2.txt new file mode 100644 index 0000000..f5f6bec --- /dev/null +++ b/Word/main_output2.txt @@ -0,0 +1 @@ +matrix |
