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 zhangzujin at 2005-07-27 14:04:12
In Reply To::哪位高手告诉我怎么结束输入啊?-用c语言 Posted by:zhangzujin at 2005-07-27 14:01:54
#include<stdio.h>

void main( )
{
	long n,k,s,r;
	while(scanf("%ld%ld",&n,&k)!=EOF)
	{
		s=n;
		r=n/k;
		while(r>0)
		{	
			s+=r;
			r/=k;
		}
		printf("%ld\n",s);
	}
}

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