結果

問題 No.293 4>7の世界
ユーザー mits58mits58
提出日時 2016-05-05 15:24:31
言語 Java21
(openjdk 21)
結果
AC  
実行時間 121 ms / 2,000 ms
コード長 866 bytes
コンパイル時間 3,250 ms
コンパイル使用メモリ 72,160 KB
実行使用メモリ 56,404 KB
最終ジャッジ日時 2023-08-28 22:09:03
合計ジャッジ時間 6,062 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,580 KB
testcase_01 AC 120 ms
55,864 KB
testcase_02 AC 119 ms
53,836 KB
testcase_03 AC 119 ms
55,860 KB
testcase_04 AC 116 ms
55,720 KB
testcase_05 AC 119 ms
55,636 KB
testcase_06 AC 119 ms
55,808 KB
testcase_07 AC 117 ms
55,740 KB
testcase_08 AC 118 ms
55,620 KB
testcase_09 AC 117 ms
55,936 KB
testcase_10 AC 119 ms
56,404 KB
testcase_11 AC 118 ms
55,748 KB
testcase_12 AC 118 ms
55,988 KB
testcase_13 AC 118 ms
56,052 KB
testcase_14 AC 118 ms
55,684 KB
testcase_15 AC 118 ms
55,828 KB
testcase_16 AC 118 ms
55,976 KB
testcase_17 AC 118 ms
55,468 KB
testcase_18 AC 118 ms
55,472 KB
testcase_19 AC 118 ms
55,892 KB
testcase_20 AC 117 ms
55,444 KB
testcase_21 AC 121 ms
55,592 KB
testcase_22 AC 119 ms
55,964 KB
testcase_23 AC 121 ms
56,028 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main{
	public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        while(sc.hasNext()){
        	String a=sc.next();
        	String b=sc.next();
        	if(a.length()>b.length()) System.out.println(a);
        	else if(a.length()<b.length()) System.out.println(b);
        	else{
        		for(int i=0;i<a.length();i++){
        			if(a.charAt(i)==b.charAt(i)) continue;
        			else{
        				int ka=a.charAt(i)-'0';
        				int kb=b.charAt(i)-'0';
        				if(ka>kb){
        					if(ka==7 && kb==4) System.out.println(b);
        					else System.out.println(a);
        				}
        				else{
        					if(kb==7 && ka==4) System.out.println(a);
        					else System.out.println(b);
        				}
        				break;
        			}
        		}
        	}
        }
    }
}
0