var a, b, с: integer;
begin
write('Введите два числа: ');
readln(a, b);
if a < b then с := a + 1 else с := b + 1;
repeat с := с - 1
until (a mod с = 0) and (b mod с = 0);
write('NOD = ', с)
end.
//2. Алгоритм с вычитанием (цикл while)
var a, b: integer;
begin
write('a = ');
readln(a);
write('b = ');
readln(b);
while a <> b do
if a > b then
a := a - b
else
b := b - a;
writeln('NOD = ', a);
end.
1)import random
s=0; random.seed()
st=''; k=0;
for i in range(3):
k=random.randint(1,6)
st+=str(k)+' '
s*=10; s+=k
print(st)
print(s*s)
1 5 2
23104
Объяснение: