蒙一武装直升机带班长:D • 1年前
using namespace std;
int n,minu,sec,x1,Y1,x2,y2; int ScoreW,ScoreT; double CntMeters;
void MetersPlus () {
double m=sqrt(pow(x1-x2,2)+pow(Y1-y2,2));
CntMeters+=m;
}
void GoalCheck () {
if (minu<45||minu==45&&!sec) {
if (x2>=25&&x2<=45) {
if (y2<=10)
ScoreT++;
else if (y2>=100)
ScoreW++;
}
} else {
if (x2>=25&&x2<=45) {
if (y2<=10)
ScoreW++;
else if (y2>=100)
ScoreT++;
}
}
}
void OutPut () {
printf ("%.2lf\n",CntMeters);
printf ("%d:%d\n",ScoreW,ScoreT);
if (ScoreW>ScoreT)
printf ("win\n");
else if (ScoreW==ScoreT)
printf ("draw\n");
else
printf ("lose\n");
}
void ExecuteProgram () {
MetersPlus();
GoalCheck();
}
void InPut () {
scanf ("%d",&n);
for (int i=1; i<=n; i++) {
scanf ("%d:%d %d %d %d %d",&minu,&sec,&x1,&Y1,&x2,&y2);
if (minu>95||minu==95&&sec)
continue;
ExecuteProgram();
}
OutPut();
}
int main () {
InPut();
return 0;
}
评论:
请先登录,才能进行评论