結果
| 問題 |
No.163 cAPSlOCK
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-07-23 12:45:23 |
| 言語 | JavaScript (node v23.5.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 455 bytes |
| コンパイル時間 | 39 ms |
| コンパイル使用メモリ | 6,944 KB |
| 実行使用メモリ | 41,464 KB |
| 最終ジャッジ日時 | 2024-06-23 17:29:32 |
| 合計ジャッジ時間 | 2,310 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;