Паскаль. Сделать из функции (Поиск НОД у 5 чисел) - процедуру.
var a,b,m1,m2,m3,ITOG,c,d,e:integer;
Function nod (x,y:integer):integer;
Begin
If x=y then NOD:=x
else
if x>y then NOD:=NOD(x-y, y)
Else NOD:=NOD(x, y-x);
end;
begin
read (a,b,c,d,e);
m1:= (nod(a,b));
m2:= (nod(c,d));
m3:= (nod(m1,m2));
ITOG:= (nod(m3,e));
writeln (ITOG);
end.
var a,b,c,d,e,m1,m2,m3,ITOG:integer; Procedure nod(x,y:integer;var n:integer); Begin If x=y then n:=x else if x>y then NOD(x-y, y, n) Else NOD(x, y-x, n); end; begin read (a,b,c,d,e); nod(a,b,m1); nod(c,d,m2); nod(m1,m2,m3); nod(m3,e,ITOG); writeln (ITOG); end.Пример:90 135 45 315 7515