Website Summary Files Commits Branches @commit @diff @stats
path: root / Week04 / Exercise18.cpp
diff options
context:
space:
mode:
Commit69de8ecfb2df52a6a4ae9d75f6a018ae380cca05 (patch)
Author
 Syndamia <kamen@syndamia.com>
2025-10-25 18:07:05 +0300
Committer
 Syndamia <kamen@syndamia.com>
2025-10-25 18:07:05 +0300
Files01718e36f21e7b661cab951c371407637ea4a00f /Week04/Exercise18.cpp
upp-2025-solutions-69de8ecfb2df52a6a4ae9d75f6a018ae380cca05.tar
upp-2025-solutions-69de8ecfb2df52a6a4ae9d75f6a018ae380cca05.tar.gz
upp-2025-solutions-69de8ecfb2df52a6a4ae9d75f6a018ae380cca05.zip
Parenteb8b89e3622f5a77027fe88930b6d38cfe73b774 (diff)
feat(Week04): Add exercises and solutions
1 files changed, 21 insertions, 0 deletions
-rw-r--r--Week04/Exercise18.cpp21
diff --git a/Week04/Exercise18.cpp b/Week04/Exercise18.cpp
new file mode 100644
index 0000000..f323c5b
--- /dev/null
+++ b/Week04/Exercise18.cpp
@@ -0,0 +1,21 @@
+#include <iostream>
+
+int main() {
+ const unsigned int NUMBER = 1337;
+
+ unsigned int guess;
+ std::cin >> guess;
+
+ while (guess != NUMBER) {
+ if (guess < NUMBER) {
+ std::cout << "Higher" << std::endl;
+ }
+ else {
+ std::cout << "Lower" << std::endl;
+ }
+ std::cin >> guess;
+ }
+ std::cout << "You guessed it!";
+
+ return 0;
+}