Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int a,b,c;
- int nww(int a, int b)
- {
- int c=a+b;
- while(a%c!=0 || b%c!=0)
- {c=c-1;}
- c=a*b/c;
- return c;
- }
- int main()
- {
- cout<<"podaj dwie liczby naturalne"<<endl;
- cin>>a;
- cin>>b;
- cout<<"najmniejsza wspolna wielokrotnosc"<<endl;
- cout<< nww(a,b);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement