結果
| 問題 |
No.293 4>7の世界
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-05-03 23:13:24 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 784 bytes |
| コンパイル時間 | 1,873 ms |
| コンパイル使用メモリ | 77,436 KB |
| 実行使用メモリ | 54,168 KB |
| 最終ジャッジ日時 | 2024-10-05 06:06:44 |
| 合計ジャッジ時間 | 5,287 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 18 WA * 2 |
ソースコード
package yukicoder;
import java.util.Scanner;
public class Main{
public static void main(String[] args)throws Exception{
new Main().solve();
}
void solve(){
Scanner sc=new Scanner(System.in);
String s1=sc.next();
String s2=sc.next();
char[] c1=s1.toCharArray();
char[] c2=s2.toCharArray();
if(c1.length>c2.length){
System.out.println(s1);
}else if(c1.length<c2.length){
System.out.println(s2);
}else if(c1.length==c2.length){
for(int i=0;i<c1.length;i++){
if(c1[i]=='4'&&c2[i]=='7'){
System.out.println(s1);
}else if(c1[i]=='7'&&c2[i]==4){
System.out.println(s2);
}else if(c1[i]>c2[i]){
System.out.println(s1);
}else if(c1[i]<c2[i]){
System.out.println(s2);
}else{
continue;
}
return;
}
}
}
}