Advertisement
Rehan_Rahman26

uri 2342

Nov 14th, 2020
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.36 KB | None | 0 0
  1. #include <stdio.h>
  2. int main()
  3. {
  4.     int c,a,b,op,sum=0;
  5.     scanf("%d",&c);
  6.     scanf("%d %c %d",&a,&op,&b);
  7.  
  8.     switch(op)
  9.     {
  10.     {case'+':
  11.         sum+=a+b;
  12.         break;}
  13.     {case'*':
  14.         sum+=a*b;
  15.         break;}
  16.     }
  17.         if(sum<=c)
  18.         printf("OK\n");
  19.         else
  20.         printf("OVERFLOW\n");
  21.  
  22.         return 0;
  23.  
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement