代码凑数(考试)// 主要不知道代码放哪.....................
TASK 1
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
freopen("task.in","r",stdin);
freopen("task.out","w",stdout);
int a,b;
cin>>a>>b;
if(a+b<10) cout<<"water"<<endl;
if((a+b>=10)&&(a>b)) cout<<"tree"<<endl;
if((a+a>=10)&&(a<=b)) cout<<"tea"<<endl;
return 0;
}
OVER
FIVESORT 2
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
freopen("fivesort.in","r",stdin);
freopen("fivesort.out","w",stdout);
int x,y,z,a,b,temp;
cin>>x>>y>>z>>a>>b;
if(x<y)
{
temp=x; x=y; y=temp;
}
if(x<z)
{
temp=x; x=z; z=temp;
}
if(y<z)
{
temp=y;y=z; z=temp;
}
if(a<b)
{
temp=a; a=b; b=temp;
}
if(x<a)
{
temp=x; x=a; a=temp;
}
if(y<a)
{
temp=y; y=a; a=temp;
}
if(z<a)
{
temp=z; z=a; a=temp;
}
if(x<b)
{
temp=x; x=b; b=temp;
}
if(y<b)
{
temp=y; y=b; b=temp;
}
if(z<b)
{
temp=z; z=b; b=temp;
}
cout<<b<<' '<<a<<' '<<z<<' '<<y<<' '<<x<<endl;
return 0;
}
OVER
//
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
freopen("fivesort.in","r",stdin);
freopen("fivesort.out","w",stdout);
int a,b,c,d,e,minn;
cin>>a>>b>>c>>d>>e;
for(int i=1;i<=5;i++)
{
minn=1000000;
if(a<minn)
minn=a;
if(b<minn)
minn=b;
if(c<minn)
minn=c;
if(d<minn)
minn=d;
if(e<minn)
minn=e;
if(a==minn)
a=10000000;
else
{
if(b==minn)
b=1000000;
else
{
if(c==minn)
c=10000000;
else
{
if(d==minn)
d=10000000;
else
e=10000000;
}
}
}
cout<<minn<<' ';
}
return 0;
}
OVER
SNAIL 3
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
freopen("snail.in","r",stdin);
freopen("snail.out","w",stdout);
int depth,days,u,d;
cin>>depth>>u>>d;
if(u<=d&&u<depth)
cout<<"bye bye";
else
{
for(int i=1;i<=10000000;i++)
{
days=i;
depth-=u;
if(depth<=0)
break;
depth+=d;
if(depth<=0)
break;
}
cout<<days;
}
OVER
//
freopen("snail.in","r",stdin);
freopen("snail.out","w",stdout);
int D,a,b,x;
cin>>D>>a>>b;
if((a>b)&&(D%a==0))
{
x=D/(a-b);
cout<<x<<endl;
}
if((a>b)&&(D%a!=0)) cout<<D/(a-b)+1<<endl;
if(a<=b) cout<<"bye bye" <<endl;
if(a>D)cout<<1<<endl;
return 0;
}
OVER
DISTANCE 4
#include<iostream>
#include<cstdio>
#include<cmath>
#include<iomanip>
using namespace std;
int main()
{
freopen("distance.in","r",stdin);
freopen("distance.out","w",stdout);
double x1,y1,x2,y2;
cin>>x1>>y1>>x2>>y2;
double a,b;
a=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
if((x1-x2>=0)&&(y1-y2>=0)) b=x1-x2+y1-y2;
if((x1-x2>=0)&&(y1-y2<0)) b=x1-x2-y1+y2;
if((x1-x2<0)&&(y1-y2>=0)) b=x2-x1+y1-y2;
if((x1-x2<0)&&(y1-y2<0)) b=x2+y2-x1-y1;
cout<<setiosflags(ios::fixed)<<setprecision(2);
cout<<a<<endl;
cout<<b<<endl;
return 0;
}
OVER