Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void triplete(int a,int b,int c)
- {
- int ok=0,x,y,z;
- for(x=a;x<=b&&x<=c/3;++x)
- for(y=x;y<=b&&x+2*y<=c;++y)
- {
- z=c-x-y;
- if(z>=y&&z<=b)
- {
- ok=1;
- cout<<"{"<<x<<","<<y<<","<<z<<"}\n";
- }
- }
- if(ok==0)
- cout<<"nu exista";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement