CSS
4
Вклад в тег
const readline = require('readline')
const fs = require('fs')
const path = require('path')
const rl = readline.createInterface({
input: fs.createReadStream(path.join(__dirname, 'input.txt'))
})
const array = []
rl.once('line', (line) => {
let counter = 0
const readline = () => {
if (counter === +line) {
for (let i = 0; i < 101; i++) {
if (array[i]) {
let str = ''
for (let j = 0; j < array[i]; j++) {
str += i.toString() + ' '
}
const fd = fs.openSync(path.join(__dirname, 'output.txt'), 'a')
fs.writeSync(fd, str)
fs.closeSync(fd)
}
}
return
}
counter++
rl.once('line', arr => {
arr = arr.match(/\d+/g)
for (let i = 1; i < arr.length; i++) {
if (array[arr[i]]) {
array[arr[i]]++
} else {
array[arr[i]] = 1
}
}
readline()
})
}
readline()
})
const mainDiv = document.getElementsByTagName('div')
let lastDiv
const finLastDiv = (el) => {
if(el.children[el.children.length - 1]) {
finLastDiv(el.children[el.children.length - 1])
}
else {
lastDiv = el
}
}
finLastDiv(mainDiv[0])
console.log(lastDiv)
console.log(lastDiv.innerHTML) // => 2