| ||||||||||
| 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 | |||||||||
我敢说这道题double是可以过的!float %f输入 ac 一点问题都没有!
double类型的,实际按照要求输入是%lf!本题可以ac!有的题目限制了输出格式?double必须%f才能过!(曾经wa了很多次才反应过来的)
以下两个,经我实验,都能AC
#include<stdio.h>
int main()
{
double d,r,t;
int k=1;
while(scanf("%lf%lf%lf",&d,&r,&t),r)
{
double n=d*r/100000*3.1415927*1.578283;
printf("Trip #%d: %.2lf %.2lf\n",k++,d*r/100000*3.1415927*1.578283,n/t*3600);
}
}
#include<stdio.h>
int main()
{
float d,r,t;
int k=1;
while(scanf("%f%f%f",&d,&r,&t),r)
{
float n=d*r/100000*3.1415927*1.578283;
printf("Trip #%d: %.2f %.2f\n",k++,d*r/100000*3.1415927*1.578283,n/t*3600);
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator