PAT 1011 A+B和C
作者:互联网
#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;
}
}
标签:count,PAT,int,double,++,res,include,1011 来源: https://blog.csdn.net/hehe_www2012/article/details/122567748