Program z1; var a,b,c,d:integer; procedure nod(x,y:integer;var nod2:integer); begin while x<>y do begin if x>y then begin x:=x-y end else begin y:=y-x end end; nod2:=xend; begin write('a=');readln(a); write('b=');readln(b); write('c=');readln(c); write('d=');readln(d); nod(a,b,b); nod(b,c,c); nod(c,d,d); writeln('nod=',d); readln end.
var a,b,c,d:integer;
procedure nod(x,y:integer;var nod2:integer);
begin
while x<>y do begin
if x>y then begin
x:=x-y
end
else begin
y:=y-x
end
end;
nod2:=xend;
begin
write('a=');readln(a);
write('b=');readln(b);
write('c=');readln(c);
write('d=');readln(d);
nod(a,b,b);
nod(b,c,c);
nod(c,d,d);
writeln('nod=',d);
readln
end.
--- Python 3.8.3 ---
import typing
from typing import Callable
from typing import Any
Primitive = typing.TypeVar('Primitive', int, float, complex, str, bytes, bytearray)
def ReadSeqWhile(predicate: Callable[[Any], bool], SeqType: Primitive = int):
'''
Возвращает последовательность элементов в указанном типе, считываемых с клавиатуры, пока ввод удовлетворяет условию
'''
temp = SeqType(input())
while predicate(temp):
yield temp
temp = SeqType(input())
def main():
InputData = ReadSeqWhile(lambda p: p != '', SeqType = str)
for _ in InputData:
print('text')
if __name__ == "__main__":
main()