結果
問題 | No.293 4>7の世界 |
ユーザー |
![]() |
提出日時 | 2016-01-29 12:13:52 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 58 ms / 2,000 ms |
コード長 | 1,126 bytes |
コンパイル時間 | 2,537 ms |
コンパイル使用メモリ | 76,264 KB |
実行使用メモリ | 37,104 KB |
最終ジャッジ日時 | 2024-12-30 11:54:34 |
合計ジャッジ時間 | 5,030 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
ソースコード
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(); } } }