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

奇怪呀??Help!!

Posted by 200530670321 at 2006-04-06 22:03:53 on Problem 1003
In Reply To:奇怪呀??Help!! Posted by:200530670321 at 2006-04-06 22:01:23
#include<stdio.h>
main()
{
	float n=2.0;
	float real,sum=0.5,t;
	scanf("%.2f",&real);
	while(real != 0.00)
	{
		while(sum<=real)
		{
			n=n+1.0;
            t=1/n;  	
		    sum=sum+t;
		}
		printf("%.0f card(s)\n",n-1);
	}
	return(0);

}
每当我输入0.00的时候它最后总是不停地在运行.
奇怪呀?
有人能帮我找一下问题的所在吗??

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