From 9eadad5d80edc766c4f8271f1f92c09b9b6595d7 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 16 Nov 2023 13:37:19 +0200 Subject: [w5] Added solutions --- week05/ex1.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 week05/ex1.cpp (limited to 'week05/ex1.cpp') 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 + +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; +} -- cgit v1.2.3