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() { int q,w,n,k; while(~scanf("%d%d",&n,&k)) { q=n;w=0; while(q>=k) { q=q/k; w+=q*k; q=n-q*k+q; n=q; } printf("%d\n",w+q); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator