Vassil_Iliev

For Marto to see

Feb 8th, 2022
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. For Martin
  2.  
  3. // Vasils try
  4. let a = +gets();
  5. let b = +gets();
  6. let c = +gets();
  7.  
  8. if (a > b && a > c && b > c) {
  9.     print(`${a} ${b} ${c}`)
  10. } else if (a > b && a > c && b < c) {
  11.     print(`${a} ${c} ${b}`)
  12. } else if (b > a && b > c && a > c) {
  13.     print(`${b} ${a} ${c}`)
  14. } else if (b > a && b > c && a < c) {
  15.     print(`${b} ${c} ${a}`)
  16. } else if (c > a && c > b && a < b) {
  17.     print(`${c} ${b} ${a}`)
  18. } else if (c > a && c > b && a > b) {
  19.     print(`${c} ${a} ${b}`)
  20. } else if (a === b && c > a) {
  21.     print(`${c} ${a} ${b}`)
  22. } else if (a === b && c < a) {
  23.     print(`${a} ${b} ${c}`)
  24. } else if (a === c && b > a) {
  25.     print(`${b} ${a} ${c}`)
  26. } else if (a === c && b < a) {
  27.     print(`${a} ${c} ${b}`)
  28. } else if (b === c && a > b) {
  29.     print(`${a} ${b} ${c}`)
  30. } else if (b === c && a < b) {
  31.     print(`${b} ${c} ${a}`)
  32. }else{
  33.     print(`${a} ${b} ${c}`);
  34. }
  35.  
  36. // Random guy try
  37. let first = Number(gets());
  38. let second = Number(gets());
  39. let third = Number(gets());
  40.  
  41. if (first>=second&&first>=third){
  42.   if (second>third){
  43.    print(first+" "+second+" "+third);
  44.    }
  45.   else{
  46.    print(first+" "+third+" "+second);
  47.    }
  48. }
  49. else if(second>=first&&second>=third){
  50.    if(first>third){
  51.   print(second+" "+first+" "+third);
  52.     }
  53.     else{
  54.    print(second+" "+third+" "+first);
  55.    }
  56. }
  57. else if(third>=first&&third>=second){
  58.    if(first>second){
  59.    print(third+" "+first+" "+second);
  60.    }
  61.    else{
  62.    print(third+" "+second+" "+first)
  63.    }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment