Advertisement
Guest User

Untitled

a guest
Nov 20th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int a, b;
  8. cout<<"Podaj pierwsza liczbe: ";
  9. cin>>a;
  10. cout<<"Podaj druga liczbe: ";
  11. cin>>b;
  12.  
  13. do
  14. {
  15. if(a>b){ a = a-b; }
  16. else { b = b-a; }
  17. }
  18. while(a!=b);
  19.  
  20. cout<<"Najwiekszy wspolny dzielnik: " << a << endl;
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement