#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,x;
int a,b,c,f[101];
int j,i;
cin>>n;
for(i=1;i<=n;i++)
{
cin>>x;
for(j=1;j<=x;j++)
{
cin>>a>>b;
f[j]=a*60+b;
c+=a*60+b;
}
sort(f,f+j+1);
cout<<"Track "<<i<<":"<<endl;
cout<<"Best Lap: "<<f[1]/60<<" minute(s) "<<f[1]%60<<" second(s)."<<endl;
cout<<"Average: "<<(c/x)/60<<" minute(s) "<<(c/x)%60<<" second(s)."<<endl<<endl;
c=0;
}
}
我在電腦測試正常,答案也沒錯。
貼到這邊就變成 Average 0 minute(s) 0 second(s) (╯◕ヮ◕)╯︵┻━┻
SSSOOOSSS~~~~~~~~~