Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let n = Number(gets(0))
- let max1 = Number.NEGATIVE_INFINITY
- let max2 = Number.NEGATIVE_INFINITY
- let max3 = Number.NEGATIVE_INFINITY
- for (let i = 1; i <= n; i++) {
- let currNum = Number(gets(i))
- if (currNum > max1) {
- max1 = currNum
- }
- for (let j = 1; j <= n; j++) {
- let currNum1 = Number(gets(j))
- if (currNum1 > max2 && currNum1<max1) {
- max2 = currNum1
- }
- for (let k = 1; k <= n; k++) {
- let curNum2 = Number(gets(k))
- if (curNum2 > max3 && curNum2 < max2) {
- max3 = curNum2
- }
- }
- }
- }
- print(max1 + ', ' + max2 + ' and ' + max3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement