//длинная арифметика
begin
var a := '123456789123456789';//ReadString();
var b := '123456789123456789123';//...
var l := Abs(a.Length - b.Length);
var source := l*'0';
if a.Length > b.Length then
insert(source, b, 1)
else
insert(source, a, 1);
var s := '';
var mem := 0;
for var i:=a.Length downto 1 do
var c := a[i].ToDigit + b[i].ToDigit + mem;
mem := c div 10;
insert((c mod 10).ToString, s, 1)
end;
if (mem > 0) then insert('1', s, 1);
s.Println;
end.
//длинная арифметика
begin
var a := '123456789123456789';//ReadString();
var b := '123456789123456789123';//...
var l := Abs(a.Length - b.Length);
var source := l*'0';
if a.Length > b.Length then
insert(source, b, 1)
else
insert(source, a, 1);
var s := '';
var mem := 0;
for var i:=a.Length downto 1 do
begin
var c := a[i].ToDigit + b[i].ToDigit + mem;
mem := c div 10;
insert((c mod 10).ToString, s, 1)
end;
if (mem > 0) then insert('1', s, 1);
s.Println;
end.
var a,b,c:array[10..99] of integer;
ast,bst,cst:string;
i:integer;
begin
ast:='A:';
bst:='Б:';
cst:='В:';
for i:=10 to 99 do
begin
c[i]:=i;
a[i]:=c[i]-i+random(50);
b[i]:=c[i]-a[i];
ast:=ast+' '+inttostr(a[i]);
bst:=bst+' '+inttostr(b[i]);
cst:=cst+' '+inttostr(c[i]);
end;
setpencolor(clRed);
line(0,0,150,0);
line(150,0,75,50);
line(75,50,0,0);
rectangle(0,50,150,300);
DrawTextCentered(0,50,150,300,ast);
setpencolor(clYellow);
line(150,0,300,0);
line(300,0,225,50);
line(225,50,150,0);
rectangle(150,50,300,300);
DrawTextCentered(150,50,300,300,bst);
setpencolor(clGreen);
line(300,0,450,0);
line(450,0,375,50);
line(375,50,300,0);
rectangle(300,50,450,300);
DrawTextCentered(300,50,450,300,cst);
end.