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