Advertisement
Guest User

Untitled

a guest
Nov 17th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. ios_base::sync_with_stdio(0);
  8. cin.tie(0);
  9. vector<int> v;
  10. int a;
  11. while(1)
  12. {
  13. cin>>a;
  14. if(a==0) break;
  15. else v.push_back(a);
  16. }
  17. sort(v.begin(),v.end());
  18. for(int i = 0; i < v.size()-2; i++)
  19. {
  20. if(v[i]+v[i+1]>v[i+2])
  21. {
  22. cout<<v[i]<<" "<<v[i+1]<<" "<<v[i+2];
  23. return 0;
  24. }
  25. }
  26. cout<<"NIE";
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement