2023-10-23 23:16:24 +02:00
|
|
|
import readline from "node:readline"
|
2021-06-09 20:31:45 +02:00
|
|
|
|
|
|
|
const input = []
|
|
|
|
const readlineInterface = readline.createInterface({
|
|
|
|
input: process.stdin,
|
2023-10-23 23:16:24 +02:00
|
|
|
output: process.stdout,
|
2021-06-09 20:31:45 +02:00
|
|
|
})
|
2023-10-23 23:16:24 +02:00
|
|
|
readlineInterface.on("line", (value) => {
|
2021-06-09 20:31:45 +02:00
|
|
|
input.push(value)
|
|
|
|
})
|
2023-10-23 23:16:24 +02:00
|
|
|
readlineInterface.on("close", solution)
|
2021-06-09 20:31:45 +02:00
|
|
|
|
|
|
|
function solution() {
|
|
|
|
const string = input[0]
|
|
|
|
const output = string
|
|
|
|
.trim()
|
2023-10-23 23:16:24 +02:00
|
|
|
.split(" ")
|
2021-06-09 20:31:45 +02:00
|
|
|
.map((word, index) => {
|
|
|
|
const isFirstElement = index === 0
|
|
|
|
if (isFirstElement) {
|
|
|
|
return word
|
|
|
|
}
|
|
|
|
return word[0].toUpperCase() + word.slice(1)
|
|
|
|
})
|
2023-10-23 23:16:24 +02:00
|
|
|
.join("")
|
2021-06-09 20:31:45 +02:00
|
|
|
console.log(output)
|
|
|
|
}
|