Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int u1,u2,u3,n;
- cin>>u1>>u2>>u3>>n;
- if (u1+u2+u3<n)
- cout<<"nema dovojno mjesta";
- if (u1+u2+u3==n)
- cout<<3;
- if (u1+u2>n>u2 and u1+u2>n>u1)
- cout<<2;
- else
- if (u1+u3>n>u1 and u1+u3>n>u3)
- cout<<2;
- else
- if (u2+u3>n>u2 and u2+u3>n>u3)
- cout<<2;
- else
- if (n<=u1 or u2 or u3)
- cout<<1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement