首页 > 其他 > 详细

uva 465 Overflow

时间:2015-07-17 11:47:29      阅读:238      评论:0      收藏:0      [点我收藏+]
#include<iostream>
#include<cctype>
#include<cstdlib>
#include<cstring>
#include<cstdio>
using namespace std;

const int MIN = -1u >> 1;

int main(){
    double a,b;
    char s1[1000],s2[1000];
    char c;
    while((scanf("%s %c %s",s1,&c,s2))!=EOF){
        printf("%s %c %s\n",s1,c,s2);
        a = atof(s1);
        b = atof(s2);
        if(a > MIN) printf("first number too big\n");
        if(b > MIN) printf("second number too big\n");
        if(c==+&&a+b>MIN)printf("result too big\n");
        if(c==*&&a*b>MIN)printf("result too big\n");
    }

    return 0;
}

 

uva 465 Overflow

原文:http://www.cnblogs.com/yong-hua/p/4653597.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!