include stdio include stdlib include math run this program using the c

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
double H, K, D;
do
{
printf("K=");
scanf("%lf=", &K);
}
while (K<=0);
do
{
printf("H=");
scanf("%lf=", &H);
}
while (H<=0);
do
{
printf("D=");
scanf("%lf=", &D);
}
while (D<=0);
K=2*(sqrt(M_PI * K));
H*=3/sqrt(0.75*H);
D=sqrt(8*D);
if (K>H)
{
if (K>D)
printf("Perimetr kruga bolshe ");
else
printf("Perimetr kvadrata bolshe ");
}
else
if (H>D)
printf("Perimetr treugolnika bolshe ");
else
printf("Perimetr kvadrata bolshe ");
system("PAUSE");
return 0;
}