Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- # include <stdio.h>
- # include <math.h>
- int main() {
- int a, b, c;
- printf("a= ");
- scanf_s(" %d", &a);
- printf("b= ");
- scanf_s(" %d", &b);
- printf("c= ");
- scanf_s(" %d", &c);
- if (a == 0 && b == 0)
- {
- return 0;
- }
- else
- {
- if (a == 0)
- {
- int x;
- x = -c / b;
- return 0;
- }
- else if (a>0)
- {
- if (c==0)
- {
- int x1;
- int x2;
- x1 = -b / a;
- x2 = 0;
- return 0;
- }
- else if (c>0)
- {
- int re;
- int d;
- int im;
- re = b / (2 * a);
- int sqrt(b);
- int fabs(b);
- d = b * b - (4 * a * c);
- im = abs(d) / (2 * a);
- if (d>0)
- {
- int x1;
- int x2;
- x1 = re + im;
- x2 = re - im;
- return 0 ;
- }
- else if (d<0)
- {
- printf_s("%d %d", re, im);
- printf_s("%d %d", re, -im);
- }
- else
- {
- int x1;
- int x2;
- x1 = re;
- x2 = x1;
- }
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement