結果

問題 No.163 cAPSlOCK
ユーザー megane_ankomegane_anko
提出日時 2021-02-09 02:58:51
言語 JavaScript
(node v21.7.1)
結果
WA  
実行時間 -
コード長 751 bytes
コンパイル時間 57 ms
コンパイル使用メモリ 5,216 KB
実行使用メモリ 44,336 KB
最終ジャッジ日時 2023-09-20 11:38:00
合計ジャッジ時間 3,789 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

const input = require('fs').readFileSync('/dev/stdin', 'utf8');

//文字列を1文字ずつ分割して配列にする、改行の部分を削除
//const ary = input.match(/.{1}/g)
const arr = input.split('\n')[0];
//答えを入れる配列を生成
let arr2 = [];
//console.log(arr);


for (let i = 0; i < arr.length; i++) {
    if (arr[i].match(/^[A-Z]*$/)) {
        //小文字に変換した文字を返す、処理してるだけ。
        arr[i].toLowerCase();
        //ary[i]に代入して、新しく作った配列に追加
        arr2.push(arr[i].toLowerCase());
        //console.log('if 文に入りました');
    } else {
        //大文字に変換
        arr[i].toUpperCase();
        arr2.push(arr[i].toUpperCase());
    }
}
0