题目

这题简单,用long long int就不会越界
PAT1011 A+B 和 C (15 分)

代码

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

相关文章:

  • 2021-12-04
  • 2021-05-09
  • 2021-07-19
  • 2021-11-26
  • 2021-09-26
  • 2022-12-23
  • 2022-01-13
猜你喜欢
  • 2021-10-25
  • 2021-11-28
  • 2022-12-23
  • 2021-05-15
  • 2022-01-29
相关资源
相似解决方案