|
|
back to boardComplete Error???????????where?where? var m,n,t,h,l,out:longint; as,bs:boolean; procedure check; var k,al,bl,ah,bh:longint; begin k:=1; while sqr(k)<m do inc(k); ah:=k; k:=1; while sqr(k)<n do inc(k); bh:=k; h:=bh-ah; al:=sqr(ah)-m-ah+1; bl:=sqr(bh)-n-bh+1; l:=abs(al-bl); if odd(sqr(ah)-m) then as:=false else as:=true; if odd(sqr(bh)-n) then bs:=false else bs:=true; end; procedure make; begin if as=bs then begin if l=0 then out:=h*2 else begin if l<=h then out:=2*h else begin out:=l+h; end; end; end else begin if as then begin if l>h then out:=l+h else out:=2*(h-1)+l; end else begin if l>h then out:=l+h else out:=2*h+1; end; end; writeln(out); end; begin readln(m,n); if m>n then begin t:=m; m:=n; n:=t; end; check; make; end. Re: Complete Error???????????where?where? as is a reserved word. |
|
|