Advertisement
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){
- do{
- if(a>b){
- a=a-b;
- } else{
- b=b-a;
- }
- }
- while(a!=b);
- cout << "Najwiekszy wspolny dzielnik: " << a << endl;
- }
- int main(){
- cout << "Dla liczb 36,6" << endl;
- nwd(36,6);
- cout << "Dla liczb 72,16" << endl;
- nwd(72,16);
- cout << "Dla liczb 125,50" << endl;
- nwd(125,50);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement