Предмет: Информатика,
автор: AmetistCat
ДАЮ МНОГО БАЛЛОВ! 9 класс. Нужно сделать номер 7 и 8, помогите пожалуйста!
Приложения:
![](https://files.topotvet.com/i/9e4/9e471220dd9d3ec5c587acb41b08597a.jpg)
Ответы
Автор ответа:
0
var
n,max:real;
begin
max:=-maxint;
writeln('Вводите числа');
repeat
repeat
readln(n);
if (n<>round(n)) then writeln('Введено не целое!');
until (n=round(n));
if n>max then max:=n;
until n=0;
writeln('Максимум: ',max);
end.
_______________________
var
n1,m1:real;
n,m,c,result,ost:integer;
begin
ost:=1;
writeln('Введите 2 числа');
repeat
readln(n1,m1);
if (n1<>round(n1))or(m1<>round(m1)) then writeln('Введено не целое!');
until (n1=round(n1))and(m1=round(m1));
n:=round(n1);
m:=round(m1);
while ost<>0 do
begin
if m>n then
begin
c:=m;
m:=n;
n:=c;
end;
ost:= n mod m;
result:=m;
n:=ost;
end;
writeln('НОД: ',m);
end.
n,max:real;
begin
max:=-maxint;
writeln('Вводите числа');
repeat
repeat
readln(n);
if (n<>round(n)) then writeln('Введено не целое!');
until (n=round(n));
if n>max then max:=n;
until n=0;
writeln('Максимум: ',max);
end.
_______________________
var
n1,m1:real;
n,m,c,result,ost:integer;
begin
ost:=1;
writeln('Введите 2 числа');
repeat
readln(n1,m1);
if (n1<>round(n1))or(m1<>round(m1)) then writeln('Введено не целое!');
until (n1=round(n1))and(m1=round(m1));
n:=round(n1);
m:=round(m1);
while ost<>0 do
begin
if m>n then
begin
c:=m;
m:=n;
n:=c;
end;
ost:= n mod m;
result:=m;
n:=ost;
end;
writeln('НОД: ',m);
end.
Похожие вопросы
Предмет: Физкультура и спорт,
автор: Аноним
Предмет: Химия,
автор: viktatoria
Предмет: Қазақ тiлi,
автор: 300319kz8
Предмет: Алгебра,
автор: Соня16012001