結果

問題 No.138 化石のバージョン
ユーザー Democo
提出日時 2015-05-03 15:41:45
言語 Java
(openjdk 23)
結果
AC  
実行時間 146 ms / 5,000 ms
コード長 641 bytes
コンパイル時間 2,535 ms
コンパイル使用メモリ 74,316 KB
実行使用メモリ 41,472 KB
最終ジャッジ日時 2024-12-29 13:13:54
合計ジャッジ時間 9,202 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
class Yukico138 {
	public static void main(String[] args) {
		Scanner stdio = new Scanner(System.in);
		String s0 = stdio.next();
		String s1 = stdio.next();
		String[] ver0 = new String[3];
		String[] ver1 = new String[3];
		ver0 = s0.split("[.]");
		ver1 = s1.split("[.]");
		boolean yes = true;
		for(int i=0; i<3; i++) {
			if(Integer.parseInt(ver0[i]) == Integer.parseInt(ver1[i])) {
				continue;
			}else if(Integer.parseInt(ver0[i]) < Integer.parseInt(ver1[i])) {
				yes = false;
				break;
			}else {
				break;
			}
		}
		if(yes) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}
}
0