Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// model bac 2018 III 3)
- #include <iostream>
- using namespace std;
- int main()
- {
- int n,x,y,z,ok=0;
- cin>>n;
- for(x=1;x<=n/2;x++)
- {
- if(n%x==0)
- for(y=x+1;y<=n/2;y++)
- {
- if(n%y==0)
- for(z=y+1;z<=n/2;z++)
- {
- if(n%z==0 && x+y+z==n)
- {
- ok=1;
- cout<<x<<" "<<y<<" "<<z<<" ";
- }
- }
- }
- }
- if(ok==0)
- {
- cout<<"0 0 0";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement