{program gcd; Shell program for calculating the gcd} {$N+,E+} uses CRT, nothy; {$I GetInput.i } var b0, c0 : extended; b, c, g : comp; i, code : integer; St : string; InputOk : Boolean; begin InputOk := False; if ParamCount = 2 then begin InputOk := True; Val(ParamStr(1), b0, code); if (code <> 0) or (frac(b0) > 0) or (Abs(b0) > MaxAllow-1) then InputOk := False else b := b0; Val(ParamStr(2), c0, code); if (code <> 0) or (frac(c0) > 0) or (Abs(c0) > MaxAllow-1) then InputOk := False else c := c0 end; if not InputOk then begin WriteLn('Will calculate (b, c).'); b := GetInput(WhereX, WhereY, ' Enter b = ', ' (³b³ ó 999999999999999999)', -MaxAllow+1, MaxAllow-1); c := GetInput(WhereX, WhereY, ' Enter c = ', ' (³c³ ó 999999999999999999)', -MaxAllow+1, MaxAllow-1); for i := 1 to 3 do begin ClrEoL; GoToXY(1, WhereY - 1) end end; ClrEoL; g := gcd(b, c); WriteLn('(', b:1:0, ', ', c:1:0, ') = ', g:1:0, '.') end.