From e2b514970884c913717b3f4b0e6a6d6bfe433976 Mon Sep 17 00:00:00 2001 From: Inex Code Date: Mon, 21 Sep 2020 07:53:24 +0000 Subject: [PATCH] Sem2 Task1 reformatting --- Sem2/task1.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Sem2/task1.cpp b/Sem2/task1.cpp index a4726dd..fac90c2 100644 --- a/Sem2/task1.cpp +++ b/Sem2/task1.cpp @@ -42,19 +42,23 @@ public: } cout << "\n"; } - DynArr operator+ (const DynArr& second) { + DynArr operator+(const DynArr& second) + { DynArr result(second); uint target_size = size; - if (second.size < size) target_size = second.size; + if (second.size < size) + target_size = second.size; for (uint i = 0; i < target_size; i++) { result.set(i, result.get(i) + arr[i]); } return result; } - DynArr operator- (const DynArr& second) { + DynArr operator-(const DynArr& second) + { DynArr result(second); uint target_size = size; - if (second.size < size) target_size = second.size; + if (second.size < size) + target_size = second.size; for (uint i = 0; i < target_size; i++) { result.set(i, arr[i] - result.get(i)); } @@ -117,6 +121,5 @@ int main() (arr + arr2).print(); cout << "Первый - второй:\n"; (arr - arr2).print(); - return 0; } \ No newline at end of file