Update 'du4/program.c'
This commit is contained in:
parent
bfc52924ce
commit
31ca326c6b
@ -47,7 +47,7 @@ int main() {
|
||||
|
||||
if (valid) {
|
||||
// Evaluate expression
|
||||
float result;
|
||||
float result = 0;
|
||||
switch (op) {
|
||||
case '+':
|
||||
result = num1 + num2;
|
||||
@ -64,14 +64,14 @@ int main() {
|
||||
}
|
||||
|
||||
}
|
||||
expected = round(expected * 100) / 100;
|
||||
if (fabs(result - expected) < 0.001) {
|
||||
result = round(result * 100) / 100;
|
||||
if (num2(result - result) < 0.001) {
|
||||
printf("OK\n");
|
||||
} else {
|
||||
printf("ZLE\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user