niepok

NWD reszta z dzielenia

Jan 25th, 2015
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.28 KB | None | 0 0
  1. program NWD_reszta_z_dzielenia;
  2. var
  3.    a,b,c,d,e:Int64;
  4. begin
  5.   write('Podaj pierwsza liczbe: ');
  6.   readln(a);
  7.   write('Podaj druga liczbe: ');
  8.   readln(b);
  9.   c:=a;
  10.   d:=b;
  11.   Repeat
  12.     e := c mod d;
  13.     c:=d;
  14.     d:=e;
  15.   until d=0;
  16.   Write('NWD to: ',c);
  17. readln;
  18. end.
Advertisement
Add Comment
Please, Sign In to add comment