uses crt;
var a:array[1..255]of integer;
i,n,vt:integer;
begin
clrscr;
repeat
write('Nhap n='); readln(n);
until (1<n) and (n<=255);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
writeln('Day so vua nhap la: ');
for i:=1 to n do
write(a[i]:4);
writeln;
vt:=n;
for i:=n downto 1 do
if a[i]>0 then
begin
if vt>i then vt:=i;
end;
if (vt=n) and (a[n]<=0) then writeln('Trong day khong co so duong')
else writeln('Chi so so hang duong dau tien trong day la: ',vt);
readln;
end.