1011 A+B 和 C

输入样例
4
1 2 3
2 3 4
2147483647 0 2147483646
0 -2147483648 -2147483647
输出样例
Case #1: false
Case #2: true
Case #3: true
Case #4: false
代码如下:
#输入
t = eval(input())
out = []#存储结果
#比较
for i in range(t):
a,b,c=map(int,input().split(' '))
d = a-c#python的int型没有长度限制,其他语言有限制,一定要防止溢出
d +=b
if d>0:
out.append("Case #{}: true".format(i+1))
else:
out.append("Case #{}: false".format(i+1))
#输出
for i in out:
print(i)
得分


229

被折叠的 条评论
为什么被折叠?



