# Untitled

unknown
c_cpp
3 years ago
1.9 kB
4
Indexable
Never
```#include <iostream>
#include <math.h>
using namespace std;

int main()
{
setlocale(LC_ALL, "rus");

int num;
cout << "Задание ";
cin >> num;

switch (num)
{
case 1:
double r, l, s;
cout << "введите R ";
cin >> r;
l = 2 * 3.14 * r;
s = 3.14 * pow(r, 2);
cout << l << endl << s << endl;
break;
case 2:
int n2, a, b, c, sum;
cout << "Введите трёхзначное число ";
cin >> n2;
a = n2 % 10;
b = n2 / 10 % 10;
c = n2 / 100 % 10;
sum = a + b + c;
cout << sum;
break;
case 3:
int n3, c3;
cout << "Введите число ";
cin >> n3;
c3 = n3 % 10;
cout << c3;
break;
case 4:
double a4, b4;
cout << "Введите a и b ";
cin >> a4 >> b4;
a4 = a4 + b4;
b4 = b4 + a4;
a4 = b4 - a4;
b4 = b4 - 2 * a4;
cout << a4 << endl << b4;
break;
case 5:
double a5, b5, c5;
cout << "Введите a и b ";
cin >> a5 >> b5;
c5 = a5;
a5 = b5;
b5 = c5;
cout << a5 << endl << b5;
break;
case 6:
double s6, m6, n6, a6, b6;
cout << "Введите S, m, n ";
cin >> s6 >> m6 >> n6;
a6 = sqrt(m6 * s6 / n6);
b6 = s6 / a6;
cout << a6 << endl << b6;
break;
case 7:
double n7, s7;
cout << "Введите n ";
cin >> n7;
s7 = pow(2 + 2 * n7, 2) / n7;
cout << s7;
break;
case 8:
int a8, b8, c8;
cout << "Введите A1, A2, A3 ";
cin >> a8 >> b8 >> c8;
a8 = a8 - b8;
b8 = 2 * a8;
c8 = 2 * c8;
c8 = c8 - a8;
a8 = 2 * a8;
cout << a8 << endl << b8 << endl << c8 << endl;
break;
case 9:
int a9, b9, m9, n9;
cout << "Введите m и n";
cin >> m9 >> n9;
b9 = (n9 - m9) / 4;
a9 = 3 * (n9 - m9) / 4;
cout << a9 << endl << b9;
break;
case 10:
double m10, n10, a10, b10, x10;
cout << "Введите m, n, a, b";
cin >> m10 >> n10 >> a10 >> b10;
x10 = (m10 - n10) / (a10 - b10);
cout << x10;
break;
default:
break;
}

}```