Advertisement
Guest User

Untitled

a guest
Nov 16th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #include<iostream>
  2. #include<cmath>
  3. #include<cstdlib>
  4. #include<time.h>
  5. #include<random>
  6. using namespace std;
  7. int main()
  8. {
  9. int a, b;
  10. do {
  11. cout << "Witaj w kalkulatorze NMD. Podaj dwie liczby";
  12. cin >> a >> b;
  13. } while (a <=0 || b <= 0);
  14. do {
  15. if (a > b)
  16. a = a - b;
  17. else
  18. b = b - a;
  19. } while (a != b);
  20. cout << a<<endl;
  21.  
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement