?>
1. There are different kinds of animals all over the world: ... 2. You can see different animals and learn new things about them in ... 3. It's interesting to watch animals ... 4. Some people fight to help... 5. People join ... 6. People should...
Ответы
function gcd(a,b:integer):integer;
// Нахождение НОД
begin
while b<>0 do
begin
a:=a mod b;
var i:=b; b:=a; a:=i
end;
Result:=a
end;
procedure Shorter(var a,b:integer);
// "сокращатель" дроби
begin
var k:=gcd(a,b);
a:=a div k;
b:=b div k
end;
begin
var a,b:integer;
Writeln('Введите числитель и знаменатель дроби: ');
Read(a,b);
Write(a,'/',b,'='); Shorter(a,b); Writeln(a,'/',b)
end.
Тестовое решение:
Введите числитель и знаменатель дроби:
25 15
25/15=5/3