結果

問題 No.163 cAPSlOCK
ユーザー fukuseifukusei
提出日時 2017-05-27 12:19:54
言語 Java21
(openjdk 21)
結果
AC  
実行時間 143 ms / 5,000 ms
コード長 482 bytes
コンパイル時間 2,341 ms
コンパイル使用メモリ 74,556 KB
実行使用メモリ 57,624 KB
最終ジャッジ日時 2023-10-21 13:17:28
合計ジャッジ時間 6,504 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
57,488 KB
testcase_01 AC 131 ms
57,304 KB
testcase_02 AC 132 ms
57,356 KB
testcase_03 AC 138 ms
57,560 KB
testcase_04 AC 137 ms
57,588 KB
testcase_05 AC 130 ms
57,356 KB
testcase_06 AC 129 ms
55,284 KB
testcase_07 AC 136 ms
57,280 KB
testcase_08 AC 137 ms
57,556 KB
testcase_09 AC 135 ms
57,332 KB
testcase_10 AC 133 ms
57,352 KB
testcase_11 AC 132 ms
55,276 KB
testcase_12 AC 135 ms
57,424 KB
testcase_13 AC 139 ms
57,556 KB
testcase_14 AC 137 ms
57,556 KB
testcase_15 AC 137 ms
57,432 KB
testcase_16 AC 137 ms
57,480 KB
testcase_17 AC 136 ms
57,320 KB
testcase_18 AC 132 ms
57,300 KB
testcase_19 AC 131 ms
57,392 KB
testcase_20 AC 133 ms
57,328 KB
testcase_21 AC 133 ms
57,392 KB
testcase_22 AC 143 ms
57,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
class test{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String str = sc.next();
		String c[] = new String [str.length()]; 
		
		for(int i=0; i<c.length; i++){
			if(str.substring(i, i+1).toUpperCase().equals( str.substring(i, i+1) ) ){
				c[i] = str.substring(i, i+1).toLowerCase();
			}
			else{
				c[i] = str.substring(i, i+1).toUpperCase();
			}
		}
		for(int i=0; i<c.length; i++){
			System.out.print(c[i]);
		}
	}
}
0