Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
水过的第36道题,贴码纪念~~~#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator