| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
大家帮看一下吧,老是WA#include<stdio.h>
struct student
{
int kph;
int time;
int get;
}stu[10000];
int main()
{
int n,i,inttemp,min,con=360*45;
double doutemp;
while(1)
{
scanf("%d",&n);
if(n==0)
break;
for(i=0;i<n;i++)
{
scanf("%d%d",&stu[i].kph,&stu[i].time);
inttemp=con/stu[i].kph;
doutemp=con/(double)stu[i].kph;
if(doutemp==(double)inttemp)
stu[i].get=inttemp;
else
stu[i].get=inttemp+1;
if(stu[i].time>=0)
if(0==i)
min=stu[i].get+stu[i].time;
else
if(stu[i].get+stu[i].time<min)
min=stu[i].get+stu[i].time;
}
printf("%d\n",min);
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator