aboutsummaryrefslogtreecommitdiff
path: root/week02/exercise06.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'week02/exercise06.cpp')
-rw-r--r--week02/exercise06.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/week02/exercise06.cpp b/week02/exercise06.cpp
new file mode 100644
index 0000000..8261301
--- /dev/null
+++ b/week02/exercise06.cpp
@@ -0,0 +1,10 @@
+#include <iostream>
+
+int main() {
+ char input;
+ std::cin >> input;
+ // Някои хора използваха конкретните числови ASCII стойности в сравнението
+ // Бих казал че това е грешка, фундаментално знаците са числа, '0' и '9' се "превеждат"
+ // до конкретните ASCII стойности от C++
+ std::cout << ('0' <= input && input <= '9') << std::endl;
+}