Odpowiedzi

2010-01-10T19:36:46+01:00
Ten program jest napisany w dev-pascalu

program Untitled;
uses crt;
var t:array[0..12,0..12] of integer;
a,b,c,x,y,N:integer;
begin
N:=12;
x:=7;
y:=1;
for a:=1 to N do
for b:=1 to N do t[a,b]:=0;
for a:=0 to N do
begin
t[a,0]:=a;
t[0,a]:=a;
end;

write('Podaj zakres tabeli (MAX 12): ');
readln(c);
clrscr;
for a:=1 to c do
begin
if (t[a,0] div 10 <> 0) then
begin
gotoxy(x-1,y);
end
else
begin
gotoxy(x,y);
end;
write(t[a,0]);
x:=x+6;
end;
x:=1;
y:=1;
for a:=0 to c do
begin
if (t[a,0] div 10 = 0) then
begin
gotoxy(x+1,y);
end
else
begin
gotoxy(x,y);
end;
write(t[0,a]);
y:=y+1;
end;
x:=7;
y:=2;
for a:=1 to c do
begin
for b:=1 to c do
begin
t[a,b]:=t[a,0]*t[0,b];
if (t[a,b] div 100)<>0 then
begin
gotoxy(x-2,y);
end
else
begin
if (t[a,b] div 10) <> 0 then
begin
gotoxy(x-1,y);
end
else
begin
gotoxy(x,y);
end;
end;
write(t[a,b]);
x:=x+6;
end;
x:=7;
y:=y+1;
end;
readln;
end.