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

求助!初来乍到,请大家帮我看一看哪里出错,在此谢过!

Posted by wjl1981317 at 2006-09-29 16:25:29 on Problem 1003
#include<stdio.h>
#define MAXNUM 10
int main()
{
	int i=0,j,k;
	float input[MAXNUM];
	int output;
	scanf("%f",&input[i]);
	while(input[i])
	{
		i++;
		scanf("%f",&input[i]);
	}
	for(j=0;j<i;j++)
	{
	output=1;
	k=2;
	while(input[j]>(float)1/k)
	{
		output++;
		input[j]-=(float)1/k;
		k++;
	}
	printf("%d card(s)\n",output);
	}
	return 1;
}

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