27

#1
#include<stdlib.h>
#include<stdio.h>
#include<math.h>
int main(void)
{
int a,b,c;
double x,y;
char k1,k2,k3;
printf("introduceti 3 valori intregi\n");
if(scanf("%d %d %d", &a, &b, &c)!=3)
{
printf("de");
exit(1);
}
printf("introduceti 2 valori reale\n");
if(scanf("%lf %lf",&x, &y)!=2)
{
printf("de");
exit(1);
}
printf("introduceti 3 caractere\n");
fflush(stdin);
scanf("%c %c %c", &k1,&k2,&k3);
printf ("valorile introduse sunt:a=%d \tb=%d \tc=%d \t x=%g \ty=%g \tk1=%c \t%k2=%c \tk3=%c", a,b,c,x,y,k1,k2,k3);
double p,s;
if (a>0 && b>0 && c>0 &&(a+b)>c && (b+c)>a && (a+c)>b)
{
p=(double)(a+b+c)/2;
s=(double)sqrt(p*(p-a)*(p-b)*(p-c));
printf("\np=%g s=%g", p,s);
}
return 0;
}
cron