From e92805eb58fe25364512dc83b2e2ca10e26f4ccd Mon Sep 17 00:00:00 2001 From: Inex Code Date: Sat, 12 Sep 2020 06:56:28 +0000 Subject: [PATCH] Homework 1: reformat task 2 --- Hw1/task2.cpp | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/Hw1/task2.cpp b/Hw1/task2.cpp index 5371dcf..1b489df 100644 --- a/Hw1/task2.cpp +++ b/Hw1/task2.cpp @@ -3,18 +3,25 @@ using namespace std; +void part1(uint N, uint M) +{ + for (uint n = 0; n < N; n++) + { + for (uint m = 0; m < M; m++) + { + cout << "*"; + } + cout << "\n"; + } + cout << "\n"; +} + int main() { - uint N = 5; - uint M = 6; + uint N = 5; + uint M = 6; - for (uint n = 0; n < N; n++) { - for (uint m = 0; m < M; m++) { - cout << "*"; - } - cout << "\n"; - } - cout << "\n"; + part1(N, M); - return 0; + return 0; }