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

水过的第36道题,贴码纪念~~~

Posted by njustcuijian at 2010-07-21 14:32:20 on Problem 2509
#include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
	int i,j,mid=1;
	int sum;
	while(cin>>i>>j)
	{
		sum=i;
		while(i/j)
		{
			sum+=i/j;
			i=i/j+i%j;
		}
		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