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 |
每次计算都要ceil(),AC代码。每次计算都要ceil()才行 #include <stdio.h> #include <string.h> #include <math.h> int main() { int n; while((scanf("%d",&n)!=EOF)&&(n!=0)) { int i; double s,t,tmp,times; times=999999.0; for(i=1;i<=n;i++) { scanf("%lf%lf",&s,&t); if(t<0) { continue; } tmp=ceil((4.5*3600)/s+t); if(tmp<times) { times=tmp; } } printf("%d\n",(int)times); } return (0); } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator