Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- For Martin
- // Vasils try
- let a = +gets();
- let b = +gets();
- let c = +gets();
- if (a > b && a > c && b > c) {
- print(`${a} ${b} ${c}`)
- } else if (a > b && a > c && b < c) {
- print(`${a} ${c} ${b}`)
- } else if (b > a && b > c && a > c) {
- print(`${b} ${a} ${c}`)
- } else if (b > a && b > c && a < c) {
- print(`${b} ${c} ${a}`)
- } else if (c > a && c > b && a < b) {
- print(`${c} ${b} ${a}`)
- } else if (c > a && c > b && a > b) {
- print(`${c} ${a} ${b}`)
- } else if (a === b && c > a) {
- print(`${c} ${a} ${b}`)
- } else if (a === b && c < a) {
- print(`${a} ${b} ${c}`)
- } else if (a === c && b > a) {
- print(`${b} ${a} ${c}`)
- } else if (a === c && b < a) {
- print(`${a} ${c} ${b}`)
- } else if (b === c && a > b) {
- print(`${a} ${b} ${c}`)
- } else if (b === c && a < b) {
- print(`${b} ${c} ${a}`)
- }else{
- print(`${a} ${b} ${c}`);
- }
- // Random guy try
- let first = Number(gets());
- let second = Number(gets());
- let third = Number(gets());
- if (first>=second&&first>=third){
- if (second>third){
- print(first+" "+second+" "+third);
- }
- else{
- print(first+" "+third+" "+second);
- }
- }
- else if(second>=first&&second>=third){
- if(first>third){
- print(second+" "+first+" "+third);
- }
- else{
- print(second+" "+third+" "+first);
- }
- }
- else if(third>=first&&third>=second){
- if(first>second){
- print(third+" "+first+" "+second);
- }
- else{
- print(third+" "+second+" "+first)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment