Advertisement
Guest User

Untitled

a guest
Mar 31st, 2015
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #include <cstdlib>
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. unsigned int A,B;
  9. unsigned int max;
  10. cout << "Unesite prvi broj: "; cin >> A;
  11. cout << "Unesite drugi broj: "; cin >> B;
  12. if (A > B) {
  13. max = A;
  14. }
  15. else {
  16. max = B;
  17. }
  18.  
  19. int vise;
  20. unsigned int min;
  21.  
  22. for (vise = max; vise <= A*B ; vise++) {
  23. if (vise % A == 0 && vise % B == 0 ) {
  24. break:
  25. }
  26.  
  27. cout << "Visekratnik brojeva " << A << " i " << B << " je: " << vise;
  28. system ("PAUSE");
  29. return 0;
  30. }
  31.  
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement