oit/9, 10 лаб/1, 2 лаб 10/1 лаб 10/FileName.cpp
2024-11-14 12:28:21 +04:00

66 lines
1000 B
C++

#include <stdio.h>
#include <Windows.h>
void Task1() {
printf("Task1() START\n");
int n;
int m;
printf("n = ");
scanf_s("%d", &n);
printf("m = ");
scanf_s("%d", &m);
int i = 1;
do {
int j = 1;
do {
printf("%d ", i * 10 + j);
j += 1;
} while (j <= m);
printf("\n");
i += 1;
} while (i <= n);
printf("Task1() FINISH()\n");
}
void Task2() {
printf("Task2() START\n");
int i = 1;//llll
do {
int j = 1;
do {
printf("%5d ", i * j);
j += 1;
} while (j <= 10);
printf("\n");
i += 1;
} while (i <= 10);
printf("Task2() FINISH()\n");
}
void main() {
SetConsoleCP(1251);
SetConsoleOutputCP(1251);
int n = 1;
do {
printf("\n");
printf("\n");
printf("Âûáåðèòå íóæíóþ âàì îïåðàöèþ\n");
printf("1: Çàäà÷à 1 (i * 10 + j)\n");
printf("2: Çàäà÷à 2 (Òàáëèöà Ïèôàãîðà)\n");
printf("\n");
printf("0: Âûéòè èç ïðîãðàììû\n");
scanf_s("%d", &n);
switch (n) {
case 1:
Task1();
break;
case 2:
Task2();
break;
}
} while (n != 0);
}