Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(first, second, third) {
- for (let i = 0; i < 3; i++) {
- if (first > second && first > third) {
- console.log(first);
- first = Number.MIN_VALUE;
- } else if (second > first && second > third) {
- console.log(second);
- second = Number.MIN_VALUE;
- } else{
- console.log(third);
- third = Number.MIN_VALUE;
- }
- }
- }
- Решение с масив и няколко метода:
- function solve(first, second, third) {
- let print = [first, second, third].sort().reverse();
- for (let i = 0; i < 3; i++){
- console.log(print[i]);
- }
- }
- Тарикатско решение:
- function solve(first, second, third) {
- console.log([first, second, third].sort().reverse().join(`\n`));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement