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 2017301530052 at 2019-09-23 16:28:19 on Problem 1003
#include<stdio.h>
#include<stdlib.h>
int main()
{
	float s,n,t;
	scanf("%f",&s);
	while(s!=0)
	{
		t=0;
		n=2;
		while(t<s)
		{
			t+=1/n;
			n++;
		}
		printf("%d card(s)\n",(int)(n-2));
		scanf("%f",&s);
	}
	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