anon606

Untitled

Oct 7th, 2012
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<stdio.h>
  2. #include<conio.h>
  3. #include<math.h>
  4. void main()
  5. {
  6.     int a,b,c;
  7.     printf("Vvedite a, b, c:\n");
  8.     scanf("%i %i %i", &a, &b, &c);
  9.     float d,D;
  10.     d=(b*b)-4*a*c;
  11.     if (d < 0)
  12.     {
  13.         printf("Korney net");
  14.         exit(1);
  15.     }
  16.     D=sqrt(d);
  17.     float x1,x1;
  18.     if (a != 0)
  19.     {
  20.         x1 = (-b+D)/(2*a);
  21.         x2 = (-b-D)/(2*a);
  22.         printf("x1 = %f; x2 = %f. \n", x1, x2);
  23.     }
  24.     else printf("Eto lineynoe");
  25.     getch();
  26. }
Advertisement
Add Comment
Please, Sign In to add comment