Function NOD(A,B:integer):integer; Begin if A>B then result:=B else result:=A; result:=result+1; Repeat result:=result-1 Until (A mod result = 0)and(B mod result = 0) End;
Var A,B:integer; Begin Write('A = ');ReadLn(A); Write('B = ');ReadLn(B); Write(NOD(A,B)) End.
Begin
if A>B then result:=B
else result:=A;
result:=result+1;
Repeat
result:=result-1
Until (A mod result = 0)and(B mod result = 0)
End;
Var
A,B:integer;
Begin
Write('A = ');ReadLn(A);
Write('B = ');ReadLn(B);
Write(NOD(A,B))
End.