标签:main amp freopen namespace include 测试 pac open end
第一题修改后答案
#include<iostream>
using namespace std;
int main()
{
int a,b,c;
cin>>a>>b;
c=a+b;//a,b分别为男,女生人数,c为总人数
if(c<10)
cout<<"water"<<endl;
if(c>10)
{
if(a>b)
cout<<"tree"<<endl;
else cout<<"tea"<<endl;
}
return 0;
}
第三题修改答案
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
freopen("snail.in","r",stdin);
freopen("snail.out","w",stdout);
int D,a,b,x=0;//x是计数器
cin>>D>>a>>b;
if(a<=b&&D>a)
cout<<"bye bye"<<endl;
else
{
for(;;)
{
x++;
D-=a;
if(D<=0)
break;
D+=b;
}
cout<<x<<endl;
}
return 0;
}
//这次测试主要失误在考虑问题不全面。以后关于细节方面的问题,一定要多加注意。
标签:main amp freopen namespace include 测试 pac open end
原文地址:http://www.cnblogs.com/lanly518/p/7256097.html