码迷,mamicode.com
首页 > 其他好文 > 详细

UVa 10055

时间:2019-03-06 01:10:00      阅读:168      评论:0      收藏:0      [点我收藏+]

标签:地方   long   mon   not   main   mpi   compile   line   uva   

说一下犯错的地方:

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

UVa 10055

标签:地方   long   mon   not   main   mpi   compile   line   uva   

原文地址:https://www.cnblogs.com/MIIEo/p/10480846.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!