mjy #936(2007/07/15 16:09 GMT) [ Pascal ] Rating3/3=1.00
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
{ Free Pascal + Run-Time Library (rtl) 2 args kuji n m } program kuji; uses SysUtils; Var n, m : Cardinal; begin if ParamCount <> 2 then Exit; n := StrToInt(paramstr(1)); m := StrToInt(paramstr(2)); if n < m then Exit; Writeln('# n=', IntToStr(n), ' m=', IntToStr(m)); Randomize; for n := n downto 1 do begin if Random(n)+1 <= m then begin WriteLn(IntToStr(n)); Dec(m); end; end; end.
Rating3/3=1.00-0+
[ reply ]
mjy #936() [ Pascal ] Rating3/3=1.00
Rating3/3=1.00-0+
[ reply ]