杭电ACM2096--小明A+B

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;
}


 

 

posted @ 2015-01-26 18:21  小小暮雨  阅读(222)  评论(0编辑  收藏  举报