#include
#include
using namespace std;
int first()
{
cout << "1." << endl</p>
<< "Введите А:" << endl;</p>
float A;
cin >> A;
float P = (1200 - A) / A;
cout << "Расстояние, которое прошёл Коля, в " << P << " раз больше,чем расстояние, пройденное Петей" << endl;</p>
return 0;
}
int second()
{
float a, b, c, p, s;
cout << "2." << endl</p>
<< "Введите a, b и c:" << endl;</p>
cin >> a >> b >> c;
if (((a + b) > c) and ((a + c) > b) and ((b + c) > a))
{
p = a + b + c;
s = sqrt((p / 2.0) * (p / 2.0 - a) * (p / 2.0 - b) * (p / 2.0 - c));
cout << "Периметр: " << p << endl</p>
<< "Площадь: " << s << endl;</p>
}
else
cout << "Такого треугольника не существует!" << endl;</p>
return 0;
}
int third()
{
int a, i, vs[40], ss[40];
char ssc[40];
cout << "3." << endl</p>
<< "Введите число:" << endl;</p>
cin >> a;
int az = a;
i = 0;
cout << "Десятичное:" << endl</p>
<< a << endl;</p>
while (a > 7)
{
vs[i] = a % 8;
a = a / 8;
i++;
}
vs[i] = a;
a = az;
cout << "Восьмеричное:" << endl;</p>
for (int k = i; k != -1; k--)
{
cout << vs[k];</p>
}
cout << endl;</p>
i = 0;
while (a > 15)
{
ss[i] = a % 16;
a = a / 16;
i++;
}
ss[i] = a;
for (int k = 0; k < 40; k++)
{
switch (ss[k])
{
case 0:
ssc[k] = '0';
break;
case 1:
ssc[k] = '1';
break;
case 2:
ssc[k] = '2';
break;
case 3:
ssc[k] = '3';
break;
case 4:
ssc[k] = '4';
break;
case 5:
ssc[k] = '5';
break;
case 6:
ssc[k] = '6';
break;
case 7:
ssc[k] = '7';
break;
case 8:
ssc[k] = '8';
break;
case 9:
ssc[k] = '9';
break;
case 10:
ssc[k] = 'A';
break;
case 11:
ssc[k] = 'B';
break;
case 12:
ssc[k] = 'C';
break;
case 13:
ssc[k] = 'D';
break;
case 14:
ssc[k] = 'E';
break;
case 15:
ssc[k] = 'F';
break;
}
}
cout << "Шестнадцатеричное:" << endl;</p>
for (int k = i; k != -1; k--)
{
cout << ssc[k];</p>
}
cout << endl;</p>
}
int main()
{
first();
second();
third();
}