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 |
大牛请进,小弟已WA数次,望各位指点迷津Program pku1306; Var m, n, n0, m0: Longint; sum: Int64; Begin Readln(n, m); While (n + m <> 0) Do Begin Sum := 1; m0 := 1; For n0:=n downto n - m + 1 Do Begin Sum := Sum * n0; While (Sum Mod m0 = 0) And (m0 <= m) Do Begin Sum := Sum Div m0; Inc(m0); End; End; Writeln(n, ' things taken ', m, ' at a time is ', Sum, ' exactly.') Readln(n, m); End; End. Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator