Advertisement
a53

Triplete1

a53
Jan 11th, 2019
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. void triplete(int n)
  2. {
  3. int d;
  4. for(d =1;d<=n/2;++d)
  5. if(n%d==0&&d<n/d)
  6. for(int i=0;i<(n/d-d)&&i<d;++i)
  7. cout<<'('<<i<<','<<d<<','<<n/d-i<<')'<<'\n';
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement