29

#1
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main (void)
{
int m,n;
double a,b,c;
char k1,k2,k3;
printf("introduceti 2 numere intregi\n");
if(scanf("%d %d", &m, &n)!=2)
{
printf("DE");
exit(1);
}
printf("introduceti 3 numere reale\n");
if(scanf("%lf %lf %lf", &a,&b,&c)!=3)
{
printf("DE");
exit(1);
}
printf("introduceti 3 caractere\n");
fflush(stdin);
scanf("%c %c %c", &k1,&k2,&k3);
printf("valorile introduse sunt: m=%d, n=%d, a=%g, b=%g, c=%g, k1=%c, k2=%c, k3=%c",m,n,a,b,c,k1,k2,k3);
double delta,x1,x2;
if(c!=0 && (pow(b,2)-4*a*c)>=0)
{
delta=pow(b,2)-4*a*c;
x1=(-b-sqrt(delta))/(2*c);
x2=(-b+sqrt(delta))/(2*c);
printf("\n x1=%g x2=%g", x1, x2);
}
else
printf("\n delta<0");
return 0;
}
cron