結果

問題 No.163 cAPSlOCK
ユーザー takutaku
提出日時 2020-09-17 10:05:14
言語 Java
(openjdk 23)
結果
AC  
実行時間 119 ms / 5,000 ms
コード長 611 bytes
コンパイル時間 1,961 ms
コンパイル使用メモリ 74,312 KB
実行使用メモリ 56,276 KB
最終ジャッジ日時 2024-06-22 06:26:53
合計ジャッジ時間 5,193 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main(String[] args) {
	    
	    Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        
        String[] str = s.split("",0);
        String[] result = new String[str.length];
        
        for(int i = 0; i < str.length; i++) {
            
            char c = s.charAt(i);
            
            if(Character.isUpperCase(c)) {
                result[i] = str[i].toLowerCase();
            }else {
                result[i] = str[i].toUpperCase();
            }
            System.out.print(result[i]);
        }
	}
}

0