Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- ifstream f ("numere.in");
- ofstream g("numere.out");
- int cmmc (int x,int y)
- {
- int p;
- p=x*y;
- while (x!=y)
- {
- if (x>y)
- x=x-y;
- else
- y=y-x;
- }
- return p/x;
- }
- int main()
- {
- int k,x,y,i;
- f>>k;
- while(f>>x)
- {
- f>>y;
- g<<cmmc(x,y)<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement