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:好阴险的水题啊,用__int64加scanf("%I64d %I64d",&n,&k)!=EOF

Posted by xj_nan at 2009-06-15 19:20:49 on Problem 2509
In Reply To:好阴险的水题啊,用__int64加scanf("%I64d %I64d",&n,&k)!=EOF Posted by:Ontheline at 2009-01-13 16:47:44
我也是int过的
#include<iostream>
using namespace std;
int main()
{
	int n,k,sum,t;
	while(cin>>n>>k)
	{
		sum=n;
		t=n;
		while(t>=k)
		{
			sum+=t/k;
			t=t/k+t%k;
		}
		cout<<sum<<endl;
	}
	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