fork download
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <vector>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8.  
  9. ios_base::sync_with_stdio(0);
  10. cin.tie(0);
  11. cout.tie(0);
  12.  
  13. int a,b,c;
  14. cin >> a>> b >> c;
  15.  
  16. vector<int> ted={a,b,c} ;
  17.  
  18. sort(ted.begin(), ted.end()) ;
  19.  
  20.  
  21. if(ted[0] != 0){
  22. cout << ted[1] <<" "<< ted[0]<<" " << ted[2];
  23. }else if(ted[1] != 0){
  24. cout << ted[1] <<" "<< ted[0]<<" " << ted[2];
  25. }else {
  26. cout << ted[2] <<" "<< ted[0]<<" " << ted[1];
  27. }
  28.  
  29.  
  30.  
  31. return 0;
  32. }
Success #stdin #stdout 0s 5324KB
stdin
4 6 0
stdout
4 0 6