#include <iostream>
#include <stdlib.h>
#include <cstdio>
#define MAX_INT 2147483647
using namespace std;
int main()
{
double a,b;
char s1[1000],s2[1000];
char c;
while(scanf("%s %c %s",s1,&c,s2)==3)
{
cout<<s1<<' '<<c<<' '<<s2<<endl;
a=atof(s1),b=atof(s2);
if(a>MAX_INT)
cout<<"first number too big"<<endl;
if(b>MAX_INT)
cout<<"second number too big"<<endl;
if((c=='+'&&a+b>MAX_INT)||(c=='*'&&a*b>MAX_INT))
cout<<"result too big"<<endl;
}
return 0;
}
UVA - 465 Overflow
最新推荐文章于 2019-02-16 22:23:44 发布