結果

問題 No.163 cAPSlOCK
ユーザー yugi0922
提出日時 2020-07-01 08:25:30
言語 Java
(openjdk 23)
結果
AC  
実行時間 57 ms / 5,000 ms
コード長 720 bytes
コンパイル時間 3,530 ms
コンパイル使用メモリ 75,476 KB
実行使用メモリ 37,560 KB
最終ジャッジ日時 2024-09-13 20:48:40
合計ジャッジ時間 5,775 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import static java.lang.System.*;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class CapsLock {
	public static void main(String[] args) throws IOException {
		InputStreamReader re = new InputStreamReader(System.in);
		BufferedReader reader = new BufferedReader(new InputStreamReader(in));
		String str = reader.readLine();
		String result = "";
		for(int i = 0; i < str.length(); i++){
			if(Character.isUpperCase( str.charAt(i))){
				String c = String.valueOf(str.charAt(i));
				c = c.toLowerCase();
				result += c;
			}else{
				String c = String.valueOf(str.charAt(i));
				c = c.toUpperCase();
				result += c;

			}
		}
		System.out.println(result);
	}
}
0