水题,过,记得类型用好就行。
#include<iostream>
using namespace std;
int a[10];//数组标记true or flase
int main()
{
int N;
long long A, B, C;
cin >> N;
for (int i = 1; i <= N; ++i)
{
cin >> A >> B >> C;
if (A + B > C)
a[i] = true;
else
a[i] = false;
}
for (int i = 1; i <= N-1; ++i)
{
cout << "Case #" << i << ": ";
if (a[i])
cout << "true";
else
cout << "false";
cout << endl;
}
cout << "Case #" << N << ": ";
if (a[N])
cout <<"true";
else
cout <<"false";
return 0;
}