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