|
@@ -2,12 +2,12 @@
|
|
uses
|
|
uses
|
|
math;
|
|
math;
|
|
{ tests:
|
|
{ tests:
|
|
- procedure DivMod(Dividend: Integer; Divisor: Word; var Result, Remainder: Word);
|
|
|
|
- procedure DivMod(Dividend: Integer; Divisor: Word; var Result, Remainder: SmallInt);
|
|
|
|
|
|
+ procedure DivMod(Dividend: LongInt; Divisor: Word; var Result, Remainder: Word);
|
|
|
|
+ procedure DivMod(Dividend: LongInt; Divisor: Word; var Result, Remainder: SmallInt);
|
|
procedure DivMod(Dividend: DWord; Divisor: DWord; var Result, Remainder: DWord);
|
|
procedure DivMod(Dividend: DWord; Divisor: DWord; var Result, Remainder: DWord);
|
|
- procedure DivMod(Dividend: Integer; Divisor: Integer; var Result, Remainder: Integer);
|
|
|
|
|
|
+ procedure DivMod(Dividend: LongInt; Divisor: LongInt; var Result, Remainder: LongInt);
|
|
}
|
|
}
|
|
-procedure doerror(i : integer);
|
|
|
|
|
|
+procedure doerror(i : LongInt);
|
|
begin
|
|
begin
|
|
writeln('Error: ',i);
|
|
writeln('Error: ',i);
|
|
halt(1);
|
|
halt(1);
|
|
@@ -18,7 +18,7 @@ var
|
|
QuotientWord,RemainderWord : Word;
|
|
QuotientWord,RemainderWord : Word;
|
|
QuotientSmallInt,RemainderSmallInt : SmallInt;
|
|
QuotientSmallInt,RemainderSmallInt : SmallInt;
|
|
QuotientDWord,RemainderDWord : DWord;
|
|
QuotientDWord,RemainderDWord : DWord;
|
|
- QuotientInteger,RemainderInteger : Integer;
|
|
|
|
|
|
+ QuotientLongInt,RemainderLongInt : LongInt;
|
|
|
|
|
|
begin
|
|
begin
|
|
DivMod($ffff,65,QuotientWord,RemainderWord);
|
|
DivMod($ffff,65,QuotientWord,RemainderWord);
|
|
@@ -45,28 +45,28 @@ begin
|
|
if RemainderDWord<>15 then
|
|
if RemainderDWord<>15 then
|
|
doerror(2004);
|
|
doerror(2004);
|
|
|
|
|
|
- DivMod($ffff,65,QuotientInteger,RemainderInteger);
|
|
|
|
- if QuotientInteger<>1008 then
|
|
|
|
|
|
+ DivMod($ffff,65,QuotientLongInt,RemainderLongInt);
|
|
|
|
+ if QuotientLongInt<>1008 then
|
|
doerror(3001);
|
|
doerror(3001);
|
|
- if RemainderInteger<>15 then
|
|
|
|
|
|
+ if RemainderLongInt<>15 then
|
|
doerror(3002);
|
|
doerror(3002);
|
|
|
|
|
|
- DivMod(123456,23,QuotientInteger,RemainderInteger);
|
|
|
|
- if QuotientInteger<>5367 then
|
|
|
|
|
|
+ DivMod(123456,23,QuotientLongInt,RemainderLongInt);
|
|
|
|
+ if QuotientLongInt<>5367 then
|
|
doerror(3003);
|
|
doerror(3003);
|
|
- if RemainderInteger<>15 then
|
|
|
|
|
|
+ if RemainderLongInt<>15 then
|
|
doerror(3004);
|
|
doerror(3004);
|
|
|
|
|
|
- DivMod(-9, 5, QuotientInteger,RemainderInteger);
|
|
|
|
- if QuotientInteger<>-1 then
|
|
|
|
|
|
+ DivMod(-9, 5, QuotientLongInt,RemainderLongInt);
|
|
|
|
+ if QuotientLongInt<>-1 then
|
|
doerror(3005);
|
|
doerror(3005);
|
|
- if RemainderInteger<>-4 then
|
|
|
|
|
|
+ if RemainderLongInt<>-4 then
|
|
doerror(3006);
|
|
doerror(3006);
|
|
|
|
|
|
- DivMod(-9, -5, QuotientInteger,RemainderInteger);
|
|
|
|
- if QuotientInteger<>1 then
|
|
|
|
|
|
+ DivMod(-9, -5, QuotientLongInt,RemainderLongInt);
|
|
|
|
+ if QuotientLongInt<>1 then
|
|
doerror(3007);
|
|
doerror(3007);
|
|
- if RemainderInteger<>-4 then
|
|
|
|
|
|
+ if RemainderLongInt<>-4 then
|
|
doerror(3008);
|
|
doerror(3008);
|
|
|
|
|
|
end.
|
|
end.
|