結果
| 問題 | No.163 cAPSlOCK |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-07-23 12:47:01 |
| 言語 | JavaScript (node v23.5.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 484 bytes |
| 記録 | |
| コンパイル時間 | 228 ms |
| コンパイル使用メモリ | 6,944 KB |
| 実行使用メモリ | 41,452 KB |
| 最終ジャッジ日時 | 2024-06-23 17:29:53 |
| 合計ジャッジ時間 | 2,477 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / 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();
}
}, '') + '\n'
);
}
const { readFileSync, existsSync } = require('fs');
const stdin = '/dev/stdin';
if (existsSync(stdin)) {
const input = readFileSync(stdin, 'utf8');
console.log(main(input));
}
module.exports = main;