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:大家要注意,不要直接除以,这样剩余烟头会没掉的。

Posted by neko13 at 2012-04-22 11:57:41 on Problem 2509
In Reply To:Re:大家要注意,不要直接除以,这样剩余烟头会没掉的。 Posted by:huhuhuhh at 2010-05-17 19:41:20
> #include<stdio.h>     
> int main()     
> {     
>     int n,k;     
>     while(scanf("%d %d",&n,&k)!=EOF)     
>     {     
> 		int t=(n-k)/(k-1)+1;
> 		printf("%d\n",n+t);
>     }     
>     return 0 ;     
> }      


2 5
这组数据会出错
正确答案是2

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