Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main ()
- {
- unsigned n,i,j,x,y,d;
- cout<<"n=";cin>>n;
- cout<<"d=";cin>>d;
- for (i=1;i<n;i++)
- for (j=i+1;j<=n;j++)
- {
- x=i;y=j;
- while (x!=y)
- if (x>y)
- x-=y;
- else
- y-=x;
- if (x==d)
- cout<<'('<<i<<';'<<j<<')'<<',';
- }
- cout<<"\b \r";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement