結果

問題 No.163 cAPSlOCK
ユーザー TwinkleStar74TwinkleStar74
提出日時 2017-09-11 22:38:23
言語 Java21
(openjdk 21)
結果
AC  
実行時間 122 ms / 5,000 ms
コード長 769 bytes
コンパイル時間 1,822 ms
コンパイル使用メモリ 74,468 KB
実行使用メモリ 41,504 KB
最終ジャッジ日時 2024-04-25 06:56:03
合計ジャッジ時間 5,215 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
41,052 KB
testcase_01 AC 110 ms
41,068 KB
testcase_02 AC 108 ms
41,196 KB
testcase_03 AC 119 ms
41,328 KB
testcase_04 AC 115 ms
40,968 KB
testcase_05 AC 100 ms
40,312 KB
testcase_06 AC 102 ms
40,536 KB
testcase_07 AC 111 ms
41,316 KB
testcase_08 AC 122 ms
41,468 KB
testcase_09 AC 117 ms
41,048 KB
testcase_10 AC 112 ms
40,984 KB
testcase_11 AC 108 ms
40,964 KB
testcase_12 AC 115 ms
41,404 KB
testcase_13 AC 107 ms
41,104 KB
testcase_14 AC 114 ms
41,200 KB
testcase_15 AC 110 ms
41,264 KB
testcase_16 AC 117 ms
41,044 KB
testcase_17 AC 117 ms
41,252 KB
testcase_18 AC 106 ms
39,928 KB
testcase_19 AC 114 ms
41,504 KB
testcase_20 AC 96 ms
40,024 KB
testcase_21 AC 109 ms
41,212 KB
testcase_22 AC 117 ms
41,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
 
class  No_163{
	public static void main (String[] args){
 
		Scanner sc = new Scanner(System.in);
                String str1 = sc.nextLine();
                String[ ] str2 = str1.split("");   //1文字ずつに分割して配列に入れる
 
                for ( int i=0; i<str2.length; i++ ){
                      if ( str2[i].equals( str2[i].toUpperCase() ) ){   //配列の文字が大文字と同じなら小文字に変換
                             str2[i] = str2[i].toLowerCase();
                      } else {
                             str2[i] = str2[i].toUpperCase();
                      }
                }
 
                for ( String alpha: str2 ){
                System.out.print (alpha);
               }

	}

}
0