hdu 2057 A+B Again

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2057

题目分析:涉及到16进制内的加法,可以用%I64x直接来处理,要注意到16进制中负数是用补码来表示的。一个比较困惑的事实是,这道题再输出时,%64X中‘X’必须是大写,小写是过不了的。

 1 #include <cstdio>
 2 int main()
 3 {
 4     __int64 a, b, c;
 5     while(~scanf("%I64x%I64x", &a, &b)){
 6         c = a+b;
 7         if(c >= 0) printf("%I64X
", c);
 8         else printf("-%I64X
", -c);
 9     }
10     return 0;
11 }
原文地址:https://www.cnblogs.com/ACFLOOD/p/4245919.html