結果

問題 No.293 4>7の世界
ユーザー 37zigen37zigen
提出日時 2016-05-03 23:13:24
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 784 bytes
コンパイル時間 2,178 ms
コンパイル使用メモリ 77,620 KB
実行使用メモリ 56,104 KB
最終ジャッジ日時 2024-04-15 11:07:29
合計ジャッジ時間 6,472 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 136 ms
53,960 KB
testcase_01 AC 132 ms
54,220 KB
testcase_02 AC 136 ms
54,240 KB
testcase_03 AC 135 ms
54,248 KB
testcase_04 AC 136 ms
54,364 KB
testcase_05 AC 136 ms
54,144 KB
testcase_06 AC 131 ms
53,924 KB
testcase_07 WA -
testcase_08 AC 133 ms
53,964 KB
testcase_09 AC 131 ms
54,012 KB
testcase_10 AC 134 ms
54,216 KB
testcase_11 AC 132 ms
54,176 KB
testcase_12 AC 128 ms
53,884 KB
testcase_13 AC 130 ms
54,160 KB
testcase_14 AC 132 ms
54,068 KB
testcase_15 AC 133 ms
54,128 KB
testcase_16 AC 129 ms
54,232 KB
testcase_17 AC 135 ms
54,316 KB
testcase_18 AC 131 ms
54,036 KB
testcase_19 AC 132 ms
53,912 KB
testcase_20 AC 134 ms
54,320 KB
testcase_21 AC 135 ms
54,300 KB
testcase_22 WA -
testcase_23 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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;
			}
		}
		
	}
}
0