結果

問題 No.163 cAPSlOCK
ユーザー papipenpapipen
提出日時 2017-03-24 14:04:21
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 477 bytes
コンパイル時間 4,530 ms
コンパイル使用メモリ 72,124 KB
実行使用メモリ 58,284 KB
最終ジャッジ日時 2023-09-20 05:34:28
合計ジャッジ時間 6,361 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,640 KB
testcase_01 AC 123 ms
55,604 KB
testcase_02 AC 123 ms
55,452 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 123 ms
55,452 KB
testcase_06 AC 124 ms
55,456 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 126 ms
55,672 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 124 ms
55,616 KB
testcase_20 WA -
testcase_21 AC 123 ms
55,764 KB
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
class Capslock{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String str1 = sc.next();
    String str2 = str1.toUpperCase();
    int c = str1.length();
    for(int i = 0; i < c; i++){
      String str3 = str1.substring(i,i+1);
      String str4 = str2.substring(i,i+1);
      if((str3).equals(str4)){
        str2 = str2.replaceFirst(str3,str3.toLowerCase());
      }
    }
    System.out.println(str2);
  }
}
0