結果

問題 No.293 4>7の世界
ユーザー 37zigen37zigen
提出日時 2016-05-03 23:14:39
言語 Java21
(openjdk 21)
結果
AC  
実行時間 121 ms / 2,000 ms
コード長 786 bytes
コンパイル時間 2,647 ms
コンパイル使用メモリ 77,512 KB
実行使用メモリ 56,252 KB
最終ジャッジ日時 2023-08-28 22:07:31
合計ジャッジ時間 6,130 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
56,048 KB
testcase_01 AC 120 ms
55,844 KB
testcase_02 AC 120 ms
55,756 KB
testcase_03 AC 117 ms
55,688 KB
testcase_04 AC 121 ms
55,832 KB
testcase_05 AC 120 ms
55,748 KB
testcase_06 AC 121 ms
55,688 KB
testcase_07 AC 118 ms
55,892 KB
testcase_08 AC 116 ms
55,900 KB
testcase_09 AC 118 ms
55,828 KB
testcase_10 AC 117 ms
55,952 KB
testcase_11 AC 120 ms
55,476 KB
testcase_12 AC 119 ms
55,644 KB
testcase_13 AC 119 ms
55,872 KB
testcase_14 AC 120 ms
55,852 KB
testcase_15 AC 120 ms
55,836 KB
testcase_16 AC 119 ms
56,252 KB
testcase_17 AC 118 ms
55,772 KB
testcase_18 AC 121 ms
55,632 KB
testcase_19 AC 119 ms
55,896 KB
testcase_20 AC 120 ms
55,808 KB
testcase_21 AC 119 ms
55,596 KB
testcase_22 AC 119 ms
55,476 KB
testcase_23 AC 119 ms
55,456 KB
権限があれば一括ダウンロードができます

ソースコード

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