結果
問題 |
No.163 cAPSlOCK
|
ユーザー |
![]() |
提出日時 | 2020-08-06 16:54:10 |
言語 | TypeScript (5.7.2) |
結果 |
AC
|
実行時間 | 80 ms / 5,000 ms |
コード長 | 858 bytes |
コンパイル時間 | 8,079 ms |
コンパイル使用メモリ | 228,456 KB |
実行使用メモリ | 39,552 KB |
最終ジャッジ日時 | 2024-12-31 16:17:22 |
合計ジャッジ時間 | 10,663 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
import { stringify } from "querystring"; function isUpperCase(input: string): boolean { if (input == input.toUpperCase()) { return true } else { return false; } } function Main(input: any) { // inputにはすべての入力の文字列が与えられるので必要に応じて input.split("\n") などで分割する。 const data = input.split("\n"); const first_line = data[0].split(" "); const S: string = first_line[0]; let answer: string = ""; for (let i: number = 0; i < S.length; i++) { let modifyChar: string = S.substr(i, 1); if (isUpperCase(modifyChar)) { modifyChar = modifyChar.toLocaleLowerCase(); } else { modifyChar = modifyChar.toUpperCase(); } answer += modifyChar; } console.log(answer); } // Don't edit this line! Main(require("fs").readFileSync("/dev/stdin", "utf8"));