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.
a = int(input())b = int(input())c = int(input())d = int(input())# либо более коротко:# a, b, c, d = map(int, input().split())
# цикл от 0 до 1000 (включительно)for x in range(1001): if a * x**3 + b * x**2 + c * x + d == 0: print(x)