From 353bccbf62d30d24d86ffce4b49558d16d718e34 Mon Sep 17 00:00:00 2001 From: Yura Shlyapin Date: Tue, 5 Nov 2024 11:06:48 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=BF=D0=B8=D1=81=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Laba10.cpp | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 Laba10.cpp diff --git a/Laba10.cpp b/Laba10.cpp new file mode 100644 index 0000000..12d0228 --- /dev/null +++ b/Laba10.cpp @@ -0,0 +1,63 @@ +#include +#include + +void Task1() { + printf("Task1() START\n"); + int n, m; + + m = 1; + do { + n = 1; + do { + printf(" %d", m * 10 + n); + n++; + } while (n <= 4); + + printf("\n"); + m++; + } while (m <= 5); + + printf("Task1() FINISH\n"); +} + +void Task2() { + printf("Task2() START\n"); + int n = 1, m = 1, i = 10; + do { + do { + printf(" %2d", n * m); + m += 1; + } while (m <= i); + + printf("\n"); + + m = 1; + n += 1; + } while (n <= 10); + + printf("Task2() FINISH\n"); +} + +void main() { + SetConsoleCP(1251); + SetConsoleOutputCP(1251); + int n; + do { + printf("\n"); + printf("\n"); + printf("Выберите нужную вам операцию:\n"); + printf("11:(m * 10 + n)\n"); + printf("12:Таблица Пифагора\n"); + printf("\n"); + printf("0:Выйти из программы\n"); + scanf_s("%d", &n); + switch (n) { + case 11: + Task1(); + break; + case 12: + Task2(); + break; + } + } while (n != 0); +} \ No newline at end of file