結果
| 問題 |
No.163 cAPSlOCK
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-03-24 14:25:49 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 477 bytes |
| コンパイル時間 | 1,853 ms |
| コンパイル使用メモリ | 74,212 KB |
| 実行使用メモリ | 41,344 KB |
| 最終ジャッジ日時 | 2024-07-06 01:47:13 |
| 合計ジャッジ時間 | 5,023 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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);
}
}