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 |
哪里错了?大侠帮忙看看#include <stdio.h> int main() { long n,k; long res; while(scanf("%ld %ld",&n,&k)==2) { res=0; if(k<=1||k>n) res=n; else { res=n; long temp=n,r=0; while(temp>=k) { temp=n/k; res+=temp; r=n%k; n=temp+r; } } printf("%ld\n",res); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator