|
|
вернуться в форумWhy "Crash (ACCESS_VIOLATION)" on first test? (+) Here is my program: {$I-,Q-,R-,S-} var ch:char; i,x:longint; s:array[1..5] of longint; function mrandom:integer; begin x:=(s[1]+s[2]+s[3]+s[4]+s[5]) mod $1000001; s[1]:=s[2]; s[2]:=s[3]; s[3]:=s[4]; s[4]:=s[5]; s[5]:=x; mrandom:=trunc((x/$1000001)*26); end; begin s[1]:=99838134; s[2]:=38475378; s[3]:=23746254; s[4]:=23452673; s[5]:=23462343; for i:=1 to 1000000 do write(chr(ord('a')+mrandom)); end. I am very surprised... Re: Why "Crash (ACCESS_VIOLATION)" on first test? (+) i submit it and got AC :P Re: Why "Crash (ACCESS_VIOLATION)" on first test? (+) as you see this simple code get AC it's the power of randomize!!!!! var i : longint; begin randomize; for i:=1 to 1000000 do write(chr(random(26)+ord('a'))); writeln; end. Re: Why "Crash (ACCESS_VIOLATION)" on first test? (+) and I got AC too... It's strange |
|
|