nikitamihailov22095010
?>

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...​

Информатика

Ответы

alenchik19938823
// PascalABC.NET 3.1, сборка 1200 от 13.03.2016

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

Ответить на вопрос

Поделитесь своими знаниями, ответьте на вопрос:

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...​
Ваше имя (никнейм)*
Email*
Комментарий*

Популярные вопросы в разделе

annarom1306
bakerkirill
Алексей Кирилл1094
VladimirovnaKashintsev1151
Galina-3639220565
Елена Ирина
polusik120796
topsalon
Irina-Tunyan
mereninka7008
ibird777
alexk13
sancity997124
zrs-546
irina611901