Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

每次计算都要ceil(),AC代码。

Posted by 2011031501037 at 2014-05-05 00:23:07 on Problem 1922
每次计算都要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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator