Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<fstream>
- using namespace std;
- ifstream fin("numere1.in.cpp");
- int cmmmc(int x,int y)
- {
- int p,r;
- p=x*y;
- while(y!=0)
- {
- r=x%y;
- x=y;
- y=r;
- }
- return p/x;
- }
- int main()
- {
- int x,y;
- while(fin>>x>>y)
- {
- cout<<cmmmc(x,y)<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement