fork(5) download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int N, P, Q, total;
  5. char C;
  6.  
  7. //scanf("%d", &N);
  8. //scanf("%d %c %d", &P, &C, &Q);
  9. scanf("%d%d %c %d", &N, &P, &C, &Q);
  10.  
  11. if (C == '+') {
  12. total = P + Q;
  13. } else {
  14. total = P * Q;
  15. }
  16.  
  17. if (total > N) {
  18. printf("OVERFLOW\n");
  19. } else {
  20. printf("OK\n");
  21. }
  22.  
  23. return 0;
  24. }
  25.  
Success #stdin #stdout 0s 2172KB
stdin
44
23 * 2
stdout
OVERFLOW