|
|
back to boardhelp me!!! I have WA 10, but I can't find my mistake, it seems that my program works very well :( help me please var a : array[0..100005] of integer; b : array[0..100005] of word; c : array[0..1005] of integer; x,y,i,m,n,d : integer; cc,p : char; begin assign(input,'input.txt'); reset(input); assign(output,'output.txt'); rewrite(output); readln(n); m := 0; i := 0; while i < n do begin read(cc); d := 0; while (not (cc in ['A'..'Z'])) do begin if EOLN then begin d := 1; break; end; read(cc); end; if d = 1 then begin readln;continue; end; if cc <> 'P' then begin readln; continue; end; inc(i); read(cc); p := cc; while p in ['P','U','S','H','O'] do read(p); if cc = 'U' then begin readln(x,y); inc(m); a[m] := y; b[m] := c[x]; c[x] := m; end else if cc = 'O' then begin readln(x); if c[x] <> 0 then begin writeln(a[c[x]]); c[x] := b[c[x]]; end; end; end; close(input); close(output); end. Re: help me!!! nobody wants to help me? Re: help me!!! 100000>32768, b[] may overflow (word) |
|
|