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 tide713 at 2005-05-02 21:40:33 on Problem 1607
In Reply To:优化后的程序 Posted by:ferrettemp at 2005-01-17 23:55:18
> #include <stdio.h>
> void main()
> {
> 	float xinxi[100000],sum=0;
> 	long i;
> 	for (i=1;i<100000;i++)
> 	{
> 		sum+=1.000000/(2*i);
> 		xinxi[i]=sum;
> 	}
> 	printf("Cards  Overhang\n");
> 	while (scanf("%ld",&i)!=-1)
> 		printf("%5d%10.3f\n",i,xinxi[i]);
> }

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