Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int a, b;
- int NWD(int a, int b){
- while(a>0){
- a=a%b;
- b=b-a;
- }
- return b;
- }
- int main()
- {
- cout << "podaj a, b:" << endl;
- cin >> a >>b ;
- cout << NWD(a,b) << endl;
- }
Add Comment
Please, Sign In to add comment