Advertisement
Guest User

zad 9 b

a guest
Oct 22nd, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3. #include <cstdlib>
  4. #include <time.h>
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10.    int pom, a, b;
  11.    cout << "Podaj liczbe:";
  12.    cin >> a;
  13.    cout << "Podaj liczbe:";
  14.    cin >> b;
  15.    while (b!=0)
  16.    {
  17.        pom=b;
  18.        b=a%b;
  19.        a=pom;
  20.    }
  21.    cout << "NWD: " << a;
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement