From 80b6fffdf40a04ed7fa719b038ee4d5380dd3a87 Mon Sep 17 00:00:00 2001 From: Oskar Date: Wed, 4 Sep 2024 19:56:28 +0200 Subject: more --- 6p5.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 6p5.cpp (limited to '6p5.cpp') 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 + +/* + * + * 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; +} -- cgit v1.2.3