Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- ifstream f("date.in");
- int cmmdc (int a, int b)
- {
- while (a != b)
- {
- if (a > b)
- {
- a = a - b;
- }
- else
- {
- b = b - a;
- }
- }
- return a;
- }
- int main()
- {
- int a1,b1,a2,b2,c1,c2,q1,q2;
- f>>a1>>b1>>a2>>b2;
- c1=a1;
- c2=a2;
- q1=b1;
- q2=b2;
- if (cmmdc(a1,b1)==1)
- cout<<c1<<" "<<q1;
- else
- if (cmmdc(a1,b1)==1)
- cout<<c2<<" "<<q2;
- else
- cout<<"Nu sunt.";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement