PAT1011 A+B 和 C (15 分)

题目

这题简单,用long long int就不会越界
在这里插入图片描述

代码

#include<iostream>
using namespace std;
int main()
{
	long long int a, b, c;
	int i;
	int total;
	cin >> total;
	for (i = 1; i <= total; i++)
	{
		cin >> a >> b >> c;
		if (a + b > c)
		{
			cout << "Case #" << i << ": true" << endl;
		}
		else
		{
			cout << "Case #" << i << ": false" << endl;
		}
	}
	//system("pause");
	return 0;
}

猜你喜欢

转载自blog.csdn.net/sinat_42483341/article/details/87921579