aboutsummaryrefslogtreecommitdiff
path: root/week05/ex1.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'week05/ex1.cpp')
-rw-r--r--week05/ex1.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/week05/ex1.cpp b/week05/ex1.cpp
new file mode 100644
index 0000000..66a55af
--- /dev/null
+++ b/week05/ex1.cpp
@@ -0,0 +1,13 @@
+#include <iostream>
+
+void pointSum(double x1, double y1, double x2, double y2, double *x, double *y) {
+ *x = x1 + x2;
+ *y = y1 + y2;
+}
+
+int main() {
+ double x1, y1, x2, y2, sumX, sumY;
+ std::cin >> x1 >> y1 >> x2 >> y2;
+ pointSum(x1, y1, x2, y2, &sumX, &sumY);
+ std::cout << sumX << " " << sumY << std::endl;
+}