結果
問題 | No.293 4>7の世界 |
ユーザー |
|
提出日時 | 2016-05-03 23:14:39 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 142 ms / 2,000 ms |
コード長 | 786 bytes |
コンパイル時間 | 3,278 ms |
コンパイル使用メモリ | 76,872 KB |
実行使用メモリ | 41,276 KB |
最終ジャッジ日時 | 2024-12-30 12:00:53 |
合計ジャッジ時間 | 7,113 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
ソースコード
package yukicoder;import java.util.Scanner;public class Main{public static void main(String[] args)throws Exception{new Main().solve();}void solve(){Scanner sc=new Scanner(System.in);String s1=sc.next();String s2=sc.next();char[] c1=s1.toCharArray();char[] c2=s2.toCharArray();if(c1.length>c2.length){System.out.println(s1);}else if(c1.length<c2.length){System.out.println(s2);}else if(c1.length==c2.length){for(int i=0;i<c1.length;i++){if(c1[i]=='4'&&c2[i]=='7'){System.out.println(s1);}else if(c1[i]=='7'&&c2[i]=='4'){System.out.println(s2);}else if(c1[i]>c2[i]){System.out.println(s1);}else if(c1[i]<c2[i]){System.out.println(s2);}else{continue;}return;}}}}