結果
問題 |
No.163 cAPSlOCK
|
ユーザー |
|
提出日時 | 2020-07-23 12:40:35 |
言語 | JavaScript (node v23.5.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 455 bytes |
コンパイル時間 | 184 ms |
コンパイル使用メモリ | 6,816 KB |
実行使用メモリ | 41,328 KB |
最終ジャッジ日時 | 2024-06-23 17:29:26 |
合計ジャッジ時間 | 2,455 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 20 |
ソースコード
function main(input = '') { if (!input) throw Error; return Array.from(input).reduce((result, c) => { if (c === c.toLowerCase()) { return result + c.toUpperCase(); } else { return result + c.toLowerCase(); } }, ''); } const { readFileSync, existsSync } = require('fs'); const stdin = '/dev/stdin'; if (existsSync(stdin)) { const input = readFileSync(stdin, 'utf8'); console.log(main(input)); } module.exports = main;