Изменил(а) на 'du4/program.c'
This commit is contained in:
parent
92634ebb01
commit
4d9c163845
@ -4,6 +4,7 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#define LINE_SIZE 150
|
#define LINE_SIZE 150
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
@ -64,7 +65,16 @@ int main() {
|
|||||||
if(symbol[j] == '=')
|
if(symbol[j] == '=')
|
||||||
p = j;
|
p = j;
|
||||||
}
|
}
|
||||||
if(symbol[p - 1] == '+'){
|
printf("%d", sym);
|
||||||
|
if(sym == 1){
|
||||||
|
//printf("a--->>%f\n", a);
|
||||||
|
//printf("b--->>%f\n", b);
|
||||||
|
b = b * -1;
|
||||||
|
sr = a - b;
|
||||||
|
//printf("%f", sr);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(symbol[p - 1] == '+'){
|
||||||
sr = a + b;
|
sr = a + b;
|
||||||
//printf("%2.f", sr);
|
//printf("%2.f", sr);
|
||||||
}
|
}
|
||||||
@ -80,6 +90,7 @@ int main() {
|
|||||||
sr = a / b;
|
sr = a / b;
|
||||||
//printf("%2.f", sr);
|
//printf("%2.f", sr);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
sr = roundf(sr * 100) / 100;
|
sr = roundf(sr * 100) / 100;
|
||||||
if(c == sr){
|
if(c == sr){
|
||||||
printf("OK\n");
|
printf("OK\n");
|
||||||
@ -87,6 +98,7 @@ int main() {
|
|||||||
else{
|
else{
|
||||||
printf("ZLE\n");
|
printf("ZLE\n");
|
||||||
}
|
}
|
||||||
|
sym = 0;
|
||||||
}
|
}
|
||||||
if (feof(stdin)) {
|
if (feof(stdin)) {
|
||||||
//printf("Dostal som sa na koniec suboru\n");
|
//printf("Dostal som sa na koniec suboru\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user