杭电ACM2096--小明A+B

来源:互联网 发布:mac无法开机黑屏 编辑:程序博客网 时间:2024/09/21 09:02

http://acm.hdu.edu.cn/showproblem.php?pid=2096

本来就是很简单。但是数据的大小有要求。

(a%100+b%100)%100和(a+b)%100本来没有什么区别,但是int型的数据类型是有范围的,所以必须严格按照要求来写。

#include <stdio.h>int main(){int a,b;int t;scanf("%d",&t);while (t--){scanf("%d%d",&a,&b);printf("%d\n",(a%100+b%100)%100);}return 0;}


 

 

0 0