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

Re:哪里错了,help help!

Posted by tzzhwj at 2008-03-09 22:31:43 on Problem 1003
In Reply To:哪里错了,help help! Posted by:19871220 at 2007-09-23 13:03:10
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
	float m;
	int array[50];
	int w=0;
	int v=0;
	while (scanf("%f",&m)==1)
	{      
		if(m==0.00) break;
		else
		{ 
			float total=0;
			int n=2;
			do
			{
				total=total+(1/n);
				n++;
			}
			while(total<m);
			array[w++]=(n+1);
		}  
		
		for(;v<(w+1);v++)
			printf("%d",array[v]);
		system("PAUSE");	
		return 0;
	}
	return 0;
}

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