結果

問題 No.293 4>7の世界
ユーザー kuramukuramu
提出日時 2016-01-29 12:13:52
言語 Java21
(openjdk 21)
結果
AC  
実行時間 44 ms / 2,000 ms
コード長 1,126 bytes
コンパイル時間 1,955 ms
コンパイル使用メモリ 73,816 KB
実行使用メモリ 49,820 KB
最終ジャッジ日時 2023-08-28 22:05:07
合計ジャッジ時間 4,117 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
49,812 KB
testcase_01 AC 43 ms
49,364 KB
testcase_02 AC 43 ms
49,480 KB
testcase_03 AC 42 ms
47,352 KB
testcase_04 AC 42 ms
49,576 KB
testcase_05 AC 43 ms
49,152 KB
testcase_06 AC 43 ms
49,448 KB
testcase_07 AC 44 ms
49,588 KB
testcase_08 AC 44 ms
49,240 KB
testcase_09 AC 43 ms
49,448 KB
testcase_10 AC 43 ms
49,392 KB
testcase_11 AC 43 ms
49,456 KB
testcase_12 AC 43 ms
49,548 KB
testcase_13 AC 42 ms
49,384 KB
testcase_14 AC 44 ms
49,292 KB
testcase_15 AC 43 ms
49,820 KB
testcase_16 AC 43 ms
49,528 KB
testcase_17 AC 43 ms
49,452 KB
testcase_18 AC 43 ms
49,272 KB
testcase_19 AC 44 ms
49,352 KB
testcase_20 AC 43 ms
49,268 KB
testcase_21 AC 43 ms
49,240 KB
testcase_22 AC 44 ms
49,388 KB
testcase_23 AC 44 ms
49,188 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) {
	      BufferedReader stdReader =new BufferedReader(new InputStreamReader(System.in));
	      try {
	    	  String[] temp = stdReader.readLine().split(" ");
	    	  if(temp[0].length() > temp[1].length()){
	    		  System.out.println(temp[0]);
	    	  }else if(temp[0].length() < temp[1].length()){
	    		  System.out.println(temp[1]);
	    	  }else{
	    		  for(int i=0;i<temp[0].length();i++){
	    			  if(temp[0].charAt(i) != temp[1].charAt(i)){
	    				  if(temp[0].charAt(i)=='4'&& temp[1].charAt(i)=='7'){
	    		    		  System.out.println(temp[0]);
	    				  }else if(temp[0].charAt(i)=='7' && temp[1].charAt(i)=='4'){
	    					  System.out.println(temp[1]);
	    				  }else if(temp[0].charAt(i) > temp[1].charAt(i)){
	    		    		  System.out.println(temp[0]);
	    				  }else{
	    					  System.out.println(temp[1]);
	    				  }
	    				  break;
	    			  }
	    		  }
	    	  }
	      } catch (IOException e) {
			e.printStackTrace();
	      }
	}
}
0