Smart pascal source code
procedure Test;
var i, j: Integer;
begin
for i := -10 to 10 do
begin
for j := -5 to 5 do
begin
var k := i * j;
WriteLn(k);
WriteLn('/');
if j <> 0 then
k := i div j
else
k := 0;
WriteLn(k);
WriteLn(' ');
end;
WriteLn('');
end;
end;
procedure Test2;
var i, j: Integer;
begin
for i := -10 to 10 do
begin
for j := -5 to 5 do
begin
var k := (i + 1) * (j + 1);
WriteLn(k);
WriteLn('/');
if j <> -1 then
k := (i + 1) div (j + 1)
else
k := 0;
WriteLn(k);
WriteLn(' ');
end;
WriteLn('');
end;
end;
Test;
WriteLn('');
Test2;
{<<< RESULT - CONSOLE LOG >>>
-----------------------------
50/2 40/2 30/3 20/5 10/10 0/0 -10/-10 -20/-5 -30/-3 -40/-2 -50/-2
45/1 36/2 27/3 18/4 9/9 0/0 -9/-9 -18/-4 -27/-3 -36/-2 -45/-1
40/1 32/2 24/2 16/4 8/8 0/0 -8/-8 -16/-4 -24/-2 -32/-2 -40/-1
35/1 28/1 21/2 14/3 7/7 0/0 -7/-7 -14/-3 -21/-2 -28/-1 -35/-1
30/1 24/1 18/2 12/3 6/6 0/0 -6/-6 -12/-3 -18/-2 -24/-1 -30/-1
25/1 20/1 15/1 10/2 5/5 0/0 -5/-5 -10/-2 -15/-1 -20/-1 -25/-1
20/0 16/1 12/1 8/2 4/4 0/0 -4/-4 -8/-2 -12/-1 -16/-1 -20/0
15/0 12/0 9/1 6/1 3/3 0/0 -3/-3 -6/-1 -9/-1 -12/0 -15/0
10/0 8/0 6/0 4/1 2/2 0/0 -2/-2 -4/-1 -6/0 -8/0 -10/0
5/0 4/0 3/0 2/0 1/1 0/0 -1/-1 -2/0 -3/0 -4/0 -5/0
0/0 0/0 0/0 0/0 0/0 0/0 0/0 0/0 0/0 0/0 0/0
-5/0 -4/0 -3/0 -2/0 -1/-1 0/0 1/1 2/0 3/0 4/0 5/0
-10/0 -8/0 -6/0 -4/-1 -2/-2 0/0 2/2 4/1 6/0 8/0 10/0
-15/0 -12/0 -9/-1 -6/-1 -3/-3 0/0 3/3 6/1 9/1 12/0 15/0
-20/0 -16/-1 -12/-1 -8/-2 -4/-4 0/0 4/4 8/2 12/1 16/1 20/0
-25/-1 -20/-1 -15/-1 -10/-2 -5/-5 0/0 5/5 10/2 15/1 20/1 25/1
-30/-1 -24/-1 -18/-2 -12/-3 -6/-6 0/0 6/6 12/3 18/2 24/1 30/1
-35/-1 -28/-1 -21/-2 -14/-3 -7/-7 0/0 7/7 14/3 21/2 28/1 35/1
-40/-1 -32/-2 -24/-2 -16/-4 -8/-8 0/0 8/8 16/4 24/2 32/2 40/1
-45/-1 -36/-2 -27/-3 -18/-4 -9/-9 0/0 9/9 18/4 27/3 36/2 45/1
-50/-2 -40/-2 -30/-3 -20/-5 -10/-10 0/0 10/10 20/5 30/3 40/2 50/2
36/2 27/3 18/4 9/9 0/0 -9/-9 -18/-4 -27/-3 -36/-2 -45/-1 -54/-1
32/2 24/2 16/4 8/8 0/0 -8/-8 -16/-4 -24/-2 -32/-2 -40/-1 -48/-1
28/1 21/2 14/3 7/7 0/0 -7/-7 -14/-3 -21/-2 -28/-1 -35/-1 -42/-1
24/1 18/2 12/3 6/6 0/0 -6/-6 -12/-3 -18/-2 -24/-1 -30/-1 -36/-1
20/1 15/1 10/2 5/5 0/0 -5/-5 -10/-2 -15/-1 -20/-1 -25/-1 -30/0
16/1 12/1 8/2 4/4 0/0 -4/-4 -8/-2 -12/-1 -16/-1 -20/0 -24/0
12/0 9/1 6/1 3/3 0/0 -3/-3 -6/-1 -9/-1 -12/0 -15/0 -18/0
8/0 6/0 4/1 2/2 0/0 -2/-2 -4/-1 -6/0 -8/0 -10/0 -12/0
4/0 3/0 2/0 1/1 0/0 -1/-1 -2/0 -3/0 -4/0 -5/0 -6/0
0/0 0/0 0/0 0/0 0/0 0/0 0/0 0/0 0/0 0/0 0/0
-4/0 -3/0 -2/0 -1/-1 0/0 1/1 2/0 3/0 4/0 5/0 6/0
-8/0 -6/0 -4/-1 -2/-2 0/0 2/2 4/1 6/0 8/0 10/0 12/0
-12/0 -9/-1 -6/-1 -3/-3 0/0 3/3 6/1 9/1 12/0 15/0 18/0
-16/-1 -12/-1 -8/-2 -4/-4 0/0 4/4 8/2 12/1 16/1 20/0 24/0
-20/-1 -15/-1 -10/-2 -5/-5 0/0 5/5 10/2 15/1 20/1 25/1 30/0
-24/-1 -18/-2 -12/-3 -6/-6 0/0 6/6 12/3 18/2 24/1 30/1 36/1
-28/-1 -21/-2 -14/-3 -7/-7 0/0 7/7 14/3 21/2 28/1 35/1 42/1
-32/-2 -24/-2 -16/-4 -8/-8 0/0 8/8 16/4 24/2 32/2 40/1 48/1
-36/-2 -27/-3 -18/-4 -9/-9 0/0 9/9 18/4 27/3 36/2 45/1 54/1
-40/-2 -30/-3 -20/-5 -10/-10 0/0 10/10 20/5 30/3 40/2 50/2 60/1
-44/-2 -33/-3 -22/-5 -11/-11 0/0 11/11 22/5 33/3 44/2 55/2 66/1
-----------------------------
{<<<<<<<<< THE END >>>>>>>>>}