SHARE
TWEET

Untitled

MeehoweCK Aug 19th, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. unsigned nwd(unsigned a, unsigned b)
  6. {
  7.     while(a != b)
  8.         if(a > b)
  9.             a -= b;
  10.         else
  11.             b -= a;
  12.     return a;
  13. }
  14.  
  15. unsigned nww(unsigned a, unsigned b)
  16. {
  17.    
  18. }
  19.  
  20. int main()
  21. {
  22.     cout << "Podaj dwie liczby naturalne: ";
  23.     unsigned a, b;
  24.     cin >> a >> b;
  25.     cout << "Najwiekszy wspolny dzielnik liczb " << a << " i " << b << " wynosi " << nwd(a, b);
  26.     cout << ", a najmniejsza wspolna wielokrotnosc wynosi " << nww(a, b) << endl;
  27.     return 0;
  28. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top