結果
| 問題 | No.293 4>7の世界 | 
| コンテスト | |
| ユーザー |  mits58 | 
| 提出日時 | 2016-05-05 15:24:31 | 
| 言語 | Java (openjdk 23) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 145 ms / 2,000 ms | 
| コード長 | 866 bytes | 
| コンパイル時間 | 2,552 ms | 
| コンパイル使用メモリ | 74,032 KB | 
| 実行使用メモリ | 41,396 KB | 
| 最終ジャッジ日時 | 2024-12-30 12:03:32 | 
| 合計ジャッジ時間 | 7,278 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 20 | 
ソースコード
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;
        			}
        		}
        	}
        }
    }
}
            
            
            
        