2022-03-30 20:03:13 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdbool.h>
|
2022-03-30 20:46:14 +00:00
|
|
|
int main ()
|
|
|
|
{
|
|
|
|
int c, vysledok, i = 0;
|
|
|
|
int b[99];
|
2022-03-30 20:03:13 +00:00
|
|
|
bool first = true;
|
|
|
|
bool second = false;
|
|
|
|
while(1){
|
2022-03-30 20:46:14 +00:00
|
|
|
c = getchar();
|
|
|
|
if(c <= 255 && c >= 0){
|
|
|
|
if(c == '\n'){
|
|
|
|
break;
|
|
|
|
}else if(c == ' '){
|
|
|
|
continue;
|
|
|
|
}else if(c == '='){
|
|
|
|
continue;
|
|
|
|
}else if(c == '+'){
|
|
|
|
first = true;
|
|
|
|
second = true;
|
|
|
|
continue;
|
|
|
|
}else if(c == '-'){
|
|
|
|
first = false;
|
|
|
|
second = false;
|
|
|
|
continue;
|
|
|
|
}else if(c == '/'){
|
|
|
|
first = true;
|
|
|
|
second = false;
|
|
|
|
continue;
|
|
|
|
}else if(c == '*'){
|
|
|
|
first = false;
|
|
|
|
second = true;
|
|
|
|
continue;
|
|
|
|
}
|
2022-03-30 20:03:13 +00:00
|
|
|
}else{
|
2022-03-30 20:46:14 +00:00
|
|
|
if(i == 2)
|
|
|
|
break;
|
|
|
|
c = 0;
|
|
|
|
int r = scanf("%d",&c);
|
|
|
|
b[i++] = c;
|
2022-03-30 20:03:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if(first == true && second == true)
|
2022-03-30 20:46:14 +00:00
|
|
|
vysledok = b[0] + b[1];
|
2022-03-30 20:03:13 +00:00
|
|
|
else if(first == false && second == false)
|
2022-03-30 20:46:14 +00:00
|
|
|
vysledok = b[0] - b[1];
|
2022-03-30 20:03:13 +00:00
|
|
|
else if(first == true && second == false)
|
2022-03-30 20:46:14 +00:00
|
|
|
vysledok = b[0] / b[1];
|
2022-03-30 20:03:13 +00:00
|
|
|
else if(first == false && second == true)
|
2022-03-30 20:46:14 +00:00
|
|
|
vysledok = b[0] * b[1];
|
|
|
|
if(vysledok == b[2])
|
2022-03-30 20:03:13 +00:00
|
|
|
printf("OK\n");
|
|
|
|
else
|
|
|
|
printf("ZLE\n");
|
|
|
|
return 0;
|
2022-03-30 20:46:14 +00:00
|
|
|
}
|