結果
| 問題 | No.163 cAPSlOCK |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-02-12 00:10:46 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 137 ms / 5,000 ms |
| コード長 | 535 bytes |
| コンパイル時間 | 2,181 ms |
| コンパイル使用メモリ | 74,496 KB |
| 実行使用メモリ | 54,264 KB |
| 最終ジャッジ日時 | 2024-07-18 10:59:31 |
| 合計ジャッジ時間 | 6,282 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
ソースコード
import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
String [] S=sc.next().split("");
String result="";
for(int i=0; i<S.length; i++){
if( S[i].matches( "[a-z]+" ) ){
result=S[i].toUpperCase();
System.out.print(result);
}else if(S[i].matches("[A-Z]")){
result=S[i].toLowerCase();
System.out.print(result);
}
}
sc.close();
}
}