結果
| 問題 |
No.163 cAPSlOCK
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-03-24 14:04:21 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 477 bytes |
| コンパイル時間 | 3,054 ms |
| コンパイル使用メモリ | 74,208 KB |
| 実行使用メモリ | 41,552 KB |
| 最終ジャッジ日時 | 2024-07-06 01:41:10 |
| 合計ジャッジ時間 | 6,312 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 5 WA * 15 |
ソースコード
import java.util.Scanner;
class Capslock{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
String str1 = sc.next();
String str2 = str1.toUpperCase();
int c = str1.length();
for(int i = 0; i < c; i++){
String str3 = str1.substring(i,i+1);
String str4 = str2.substring(i,i+1);
if((str3).equals(str4)){
str2 = str2.replaceFirst(str3,str3.toLowerCase());
}
}
System.out.println(str2);
}
}