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

float还是double

Posted by snowfall at 2008-05-19 21:13:44 on Problem 1665
为什么用float就能过,double就不行呢 

#include<iostream>
using namespace std;
const double pi=3.1415926;
int main()
{
    double d,t;
    long r,count=1;
    double e,s;
    
    scanf("%f%d%f",&d,&r,&t);
    
    while(r!=0)
    {
          e=pi*d*r/(12*5280);
          s=pi*d*r*3600/(12*5280*t);
          printf("Trip #%d: %.2f %.2f\n",count,e,s);
          count++;
          scanf("%f%d%f",&d,&r,&t);
    }
    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