#include int main(){ int c[999]; int i = 0; int vysledok; char riadok[999]; char *endptr = NULL; char need; while(1){ char* r = fgets(riadok,999,stdin); if(*r == '\n'){ break; }else if(*r == ' ') continue; else if(*r == '+'){ need = *r; continue; }else if(*r == '-'){ need = *r; continue; }else if(*r == '/'){ need = *r; continue; }else if(*r == '*'){ need = *r; continue; }else{ int v = strtod(riadok,&endptr); c[i++] = v; continue; } } if(need == '+') vysledok = c[0] + c[1]; else if(need == '-') vysledok = c[0] - c[1]; else if(need == '/') vysledok = c[0] / c[1]; else if(need == '*') vysledok = c[0] * c[1]; if(vysledok == c[i]) printf("OK\n"); else printf("ZLE\n"); return 0; }