ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1086. Cryptography

HELP ME PLEASE
Posted by Valentina 12 Feb 2016 23:02
Господа, помогите, пожалуйста, новичку ликвидировать "access violation"!

Here is 'access violation' error but i don't see anything wrong and my code works perfectly on my computer. Could anybody help?

var a :array [1..1000] of integer; kol,s,ch,n,i,k,j,q:integer;
begin
readln(n);
for i:=1 to n do read(a[i]);

ch:=3;

for i:=1 to n do
begin
if a[i]=1 then writeln('2');
kol:=0;
k:=1;
ch:=3;
  while k<a[i] do
    begin
    for s:=2 to (ch-1) do
    if ch mod s = 0 then kol:=kol+1;
    if kol=0 then k:=k+1;
    if k=a[i] then writeln(ch);
    ch:=ch+1;
    kol:=0;
    end;

end;
end.



Edited by author 12.02.2016 23:11