Subscribe Us

Responsive Advertisement

Advertisement

URI Online Judge | 2342 Overflow solution in cpp

 uri 2342 solution in cpp

by ujjal roy



#include<bits/stdc++.h>

using namespace std;

main()

{


    int a,b,r,n;

    char c;

    cin>>n;

    cin>>a>>c>>b;

    if(c=='+') r=a+b;

    else if(c=='*') r=a*b;

    if(r>n) cout<<"OVERFLOW"<<endl;

    else cout<<"OK"<<endl;


    return 0;

}


Post a Comment

0 Comments