結果
問題 |
No.163 cAPSlOCK
|
ユーザー |
![]() |
提出日時 | 2021-02-09 02:58:51 |
言語 | JavaScript (node v23.5.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 751 bytes |
コンパイル時間 | 201 ms |
コンパイル使用メモリ | 6,816 KB |
実行使用メモリ | 39,544 KB |
最終ジャッジ日時 | 2024-07-06 07:02:24 |
合計ジャッジ時間 | 3,475 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 20 |
ソースコード
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()); } }