UVa 10055

说一下犯错的地方:

1)没有注意数据范围,题目中是The input numbers are not greater than balabalabala. 而这个32位的int类型恰好装不下2^32,所以,你懂的

2)scanf那个地方,没有用%ld,用的是%d;printf那个地方也是

语言(提交的时候选择的这个选项):ANSI C 5.3.0 - GNU C Compiler with options: -lm -lcrypt -O2 -pipe -ansi -DONLINE_JUDGE

本地编程环境:Dev C++ 5.11 默认编译器和链接器配置

附通过的代码:

#include<stdio.h>

int main(){
    long int a, b;
    while((scanf("%ld %ld",&a,&b))!=EOF){
        printf("%ld\n",a>b?a-b:b-a);
    }
    return 0;
} 

 

than 32
posted @ 2019-03-06 00:19  MIIEo  阅读(217)  评论(0)    收藏  举报