-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_generatedCode.c
More file actions
65 lines (64 loc) · 845 Bytes
/
_generatedCode.c
File metadata and controls
65 lines (64 loc) · 845 Bytes
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#define A_Long_Dead_Memory 0
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
int main(void){
float a = 0.0;
float b = 0.0;
float c = 0.0;
float D = 0.0;
std::cin >> a;
std::cin >> b;
std::cin >> c;
std::cout << std::endl;
D=( b*b-( 4*a*c ) );
if(D<0)
{
std::cout << false;
}
if(D==0)
{
if(a==0)
{
if(!(c==0))
{
std::cout << false;
}
std::cout << true;
}
if(!(a==0))
{
float x = 0.0;
x=( (-b)/( 2*a ) );
std::cout << x;
std::cout << std::endl;
std::cout << x;
}
}
if(D>0)
{
if(a==0)
{
float x = 0.0;
x=( (-c)/b );
std::cout << x;
std::cout << std::endl;
std::cout << x;
}
if(!(a==0))
{
float x = 0.0;
float y = 0.0;
x=( ( (-b)-sqrt(D) )/( 2*a ) );
y=( ( (-b)+sqrt(D) )/( 2*a ) );
std::cout << x;
std::cout << std::endl;
std::cout << y;
}
}
std::cout << std::endl;
std::cout << std::endl;
system("PAUSE");
return 0;
}