Website Summary Files Commits Branches @commit @diff @stats
path: root / Week03 / Exercise03.cpp
diff options
context:
space:
mode:
1 files changed, 19 insertions, 0 deletions
-rw-r--r--Week03/Exercise03.cpp19
diff --git a/Week03/Exercise03.cpp b/Week03/Exercise03.cpp
new file mode 100644
index 0000000..3d76b46
--- /dev/null
+++ b/Week03/Exercise03.cpp
@@ -0,0 +1,19 @@
+#include <iostream>
+
+int main() {
+ int a, b, c;
+ std::cin >> a >> b >> c;
+ /* Алтернативно може да направите:
+ * int a;
+ * int b;
+ * int c;
+ * std::cin >> a;
+ * std::cin >> b;
+ * std::cin >> c;
+ */
+
+ std::cout << ((b - a) == (c - b));
+ /* Друга формула, която също работи е:
+ * (a + c) / 2 == b
+ */
+}