#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int n;
cin>>n;
double a,b,c;
string t[100000];
int count=0;
for(int i=0;i<n;i++)
{
cin>>a>>b>>c;
double res = a+b;
if(res>c)
{
t[count] = "true"; count++;
}
else{
t[count] = "false"; count++;
}
}
for(int i=0;i<count;i++)
{
if(i==(count-1))
{
cout<<"Case #"<<i+1<<": "<<t[i];
break;
}
cout<<"Case #"<<i+1<<": "<<t[i]<<endl;
}
}
PAT 1011 A+B和C
最新推荐文章于 2026-04-22 16:13:26 发布
本文介绍了一个简单的C++程序,用于判断输入的三条边是否能构成三角形。程序接收用户输入的三个浮点数作为边长,并通过比较判断这三条边是否满足构成三角形的条件。最终,程序会输出每个案例的结果。
289

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



