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 |
我也是Pascal,注意一下输入>>In Reply To:Help Problem D Posted by:My_loves at 2005-07-27 14:33:24 > 没想法了。这种题目都会WA! > 帮我看看。是不是我理解错了 > > program p2509; > var n,k:integer; > out:longint; > > procedure main; > var i,j,butt:integer; > begin > out:=n; > butt:=n; > repeat > out:=out+butt div k; > butt:=butt mod k +butt div k; > until butt<k; > end; > > begin > repeat > readln(n,k); > if n=0 then halt; > main; > writeln(out); > until eof; > end. Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator