|
|
вернуться в форумWhy I get WA?I think my program is right,but still got WA Послано qwt 21 мар 2002 17:57 const ss:array[1..6] of string[7]=( 'one ', 'puton ', 'in ', 'input ', 'out ', 'output '); var z:char; a:array[1..6] of longint; i,j,k,n:longint; useful,t,f,o:boolean; begin readln(n); for i:=1 to n do begin useful:=true; fillchar(a,sizeof(a),0); o:=true;; while not(eoln) do begin read(z);t:=false;f:=false; for j:=1 to 6 do if z=ss[j,a[j]+1] then begin if (a[j]=0)and(o=false) then continue; t:=true; inc(a[j]); if ss[j][a[j]+1]=' ' then begin a[j]:=0;f:=true;end; end else begin a[j]:=0; if (o)and(ss[j][1]=z) then begin inc(a[j]);f:=true;end; end; if t=false then begin f:=false;break;end; o:=f; end; readln; if f then writeln('YES') else writeln('NO'); end; end. |
|
|