summaryrefslogtreecommitdiff
path: root/6p5.cpp
diff options
context:
space:
mode:
Diffstat (limited to '6p5.cpp')
-rw-r--r--6p5.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/6p5.cpp b/6p5.cpp
new file mode 100644
index 0000000..bcdec06
--- /dev/null
+++ b/6p5.cpp
@@ -0,0 +1,25 @@
+#include <iostream>
+
+/*
+ *
+ * 6.5
+ *
+ *
+ */
+
+int AbsoluteValue(int v) {
+
+ if (v < 0) {
+ return -v;
+ }
+
+ return v;
+}
+
+int main () {
+
+ int v;
+ if(std::cin >> v) {} else { return -1; }
+ std::cout << AbsoluteValue(v) << std::endl;
+ return 0;
+}