GamerSK

najvacsispolocnydelitel

Feb 9th, 2017
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.44 KB | None | 0 0
  1. //Vytvorte program ktory nacita dve prirodzene cisla a najde spolocny nasobok
  2. program najvacsispolocnydelitel;
  3. {$APPTYPE CONSOLE}
  4. uses SysUtils;
  5. var c1,c2:byte;
  6. begin
  7.   { TODO -oUser -cConsole Main : Insert code here }
  8.   write('Zadajte 1 cislo: ');
  9.   readln(c1);
  10.   write('Zadajte 2 cislo: ');
  11.   readln(c2);
  12.   while (c1<>c2) do
  13.     if c1 > c2 then c1:=c1-c2
  14.       else c2:=c2-c1;
  15.   writeln('Spolocny delitel je: ',c1);
  16.   readln;
  17. end.
Advertisement
Add Comment
Please, Sign In to add comment