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

我敢说这道题double是可以过的!

Posted by w598113636 at 2012-01-26 21:30:48 on Problem 1665
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:
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