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 xiaolijian at 2010-07-19 20:34:27 on Problem 2509
#include <stdio.h>

void main()
{
	int n,k,a,b;
	while(scanf("%d",&n)&&scanf("%d",&k))
	{
		b=n*k%(k-1);
		
		if(b==0)
			a=n*k/(k-1)-1;
		else
			a=n*k/(k-1);
		printf("%d\n",a);
	}
}
超了
换成while(scanf("%d",&n)&&scanf("%d",&k)!=EOF)则 程序错误

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