~51일차~
let fs = require('fs');
let input = fs.readFileSync('/dev/stdin').toString().split('\n')
let arr = input[0].slit(' ')
arr.sort(function (a,b) {
return a - b;
});
let fs = require('fs');
let input = fs.readFileSync('/dev/stdin').toString().split('\n')
let arr = input[0].split(' ').map(Number);
arr.sort(function (a,b) {
return a - b;
});
let answer = "";
for (let i = 0; i < arr.length; i++) {
answer += arr[i] + " ";
}
console.log(answer);
let fs = require('fs');
let input = fs.readFileSync('/dev/stdin').toString().split('\n')
let n = Number(input[0])
let arr = []
for(let i = 1; i <=n, i++) {
arr.push(Number(input[i]));
}
arr.sort(function (a,b) {
return a - b;
});
let answer = "";
for (let i = 0; i < arr.length; i++) {
answer += arr[i] + "\n";
}
console.log(answer);
2번 문제와 동일
let fs = require('fs');
let input = fs.readFileSync('/dev/stdin').toString().split('\n')
let [n, k] = input[0].slit(' ').map(Number);
let arr = input[1].split(' ').map(Number);
arr.sort(function (a,b) {
return a - b;
});
console.log(arr[k-1]);