Advertisement
marijak

Untitled

Oct 25th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. int u1,u2,u3,n;
  2. cin>>u1>>u2>>u3>>n;
  3. if (u1+u2+u3<n)
  4. cout<<"nema dovojno mjesta";
  5. if (u1+u2+u3==n)
  6. cout<<3;
  7. if (u1+u2>n>u2 and u1+u2>n>u1)
  8. cout<<2;
  9. else
  10. if (u1+u3>n>u1 and u1+u3>n>u3)
  11. cout<<2;
  12. else
  13. if (u2+u3>n>u2 and u2+u3>n>u3)
  14. cout<<2;
  15.  
  16.  
  17.  
  18.  
  19. else
  20. if (n<=u1 or u2 or u3)
  21. cout<<1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement