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 ",(a%100+b%100)%100); } return 0; }