|
|
back to boardWhy error?Test number 3 Posted by Pavel 25 Jun 2008 21:05 Code: var i,l,a,b,max,z,d:integer; otvet:string; x,y:array[1..50000]of integer; bo:boolean; begin bo:=true; readln(a); if (a>=1)and(a<=50000) then begin for i:=1 to a do begin readln(x[i]); end; readln(b); for i:=1 to b do begin readln(y[i]); end; if a>b then max:=a; if b>a then max:=b; for i:=1 to max do begin if bo=true then begin for l:=1 to max do begin z:=x[i]+y[l]; if z=10000 then begin d:=1; bo:=false; end; end; end; end; if d=1 then otvet:='YES' else otvet:='NO'; write(otvet); end; end. BECAUSE ERROR? Re: Why error?Test number 3 Because you are must use if a>=b then max:=a; if b>a then max:=b; |
|
|