test2/Laba10.cpp
2024-11-05 11:06:48 +04:00

63 lines
898 B
C++

#include <stdio.h>
#include <Windows.h>
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);
}