結果
問題 |
No.293 4>7の世界
|
ユーザー |
|
提出日時 | 2015-12-19 18:48:39 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 652 bytes |
コンパイル時間 | 2,061 ms |
コンパイル使用メモリ | 74,420 KB |
実行使用メモリ | 55,884 KB |
最終ジャッジ日時 | 2024-09-16 16:10:28 |
合計ジャッジ時間 | 6,064 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 14 WA * 6 |
ソースコード
import java.util.Scanner; public class Main{ public static void main(String... args){ Scanner scan = new Scanner(System.in); int a = scan.nextInt(); int b = scan.nextInt(); if(a < b){ System.out.println(getResult(b,a)); }else{ System.out.println(getResult(a,b)); } } public static int getResult(int l,int s){ String l_s = String.valueOf(l); String s_s = String.valueOf(s); if(l_s.length() != s_s.length())return l; int result = 0; for(int i = 0; i < l_s.length(); i++){ if(l_s.charAt(i) == '4'){ result = l; break; }else if(s_s.charAt(i) == '4'){ result = s; break; } } return result; } }