Advertisement
ridjis

navecizajednicki14

Nov 14th, 2013
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. (* najveci zajednicki delilac *)
  2. MODULE najvzad;
  3. FROM InOut IMPORT WriteLn, WriteString, WriteCard, ReadCard;
  4. VAR m,n,i,c,max: CARDINAL;
  5. BEGIN
  6. WriteString('Unesite broj m: ');
  7. ReadCard(m);
  8. WriteLn;
  9.  
  10. WriteString('Unesite broj n: ');
  11. ReadCard(n);
  12. WriteLn;
  13.  
  14. IF m > n THEN
  15. c:=m;
  16. ELSE
  17. c:=n;
  18. END;
  19.  
  20. FOR i:=1 TO c DO
  21. IF (m MOD i = 0) AND (n MOD i = 0) THEN
  22. max:=i;
  23. END;
  24. END;
  25. WriteString('najveci delilac je: ');
  26. WriteCard(max,0);
  27. WriteLn;
  28. END najvzad.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement