Advertisement
dzieciol

nwd nww

Mar 16th, 2015
592
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.34 KB | None | 0 0
  1.  program funkcja;
  2.  uses crt;
  3.  var
  4.  a,b,p: integer;
  5.  nww:real;
  6.  
  7.  begin
  8.   writeln('podaj a');
  9.   readln(a);
  10.   writeln('podaj droga liczbe');
  11.   readln(b) ;
  12.   nww:=a*b;
  13.   while b<>0  do begin
  14.   p:=a mod b ;
  15.   a:=b      ;
  16.   b:=p      end;
  17.  
  18.   nww:=nww/a;
  19.   writeln('nwd =',a)  ;
  20.   writeln('nww=',nww);
  21.    repeat until keypressed;
  22.   end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement