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

猜你喜欢

转载自www.cnblogs.com/MIIEo/p/10480846.html