Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int a,b,c,cb,ca,cc;
- cin>>a>>b;
- c=b;
- while (a!=0&&b!=0&&c!=0)
- {
- ca=a;
- // cb=b;
- cin>>c;
- cc=c;
- if (cc==0)
- break;
- // cc=c;
- while (a!=c)
- {
- if (a>c)
- a-=c;
- else
- c-=a;
- }
- if (b==c)
- cout<<ca<<" "<<b<<" "<<cc;
- a=b;
- b=cc;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement