| ||||||||||
| 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 | |||||||||
float还是double为什么用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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator