結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー YamaKasa
提出日時 2018-05-24 23:41:05
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 661 bytes
コンパイル時間 2,182 ms
コンパイル使用メモリ 74,596 KB
実行使用メモリ 41,352 KB
最終ジャッジ日時 2024-06-28 17:34:55
合計ジャッジ時間 4,994 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 11 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String A = scan.next();
		String B = scan.next();
		scan.close();
		if(isNumber(A) && isNumber(B)) {
			int a = Integer.parseInt(A);
			int b = Integer.parseInt(B);
			System.out.println("OK");
		}else {
			System.out.println("NG");
		}
	}
	public static boolean isNumber(String num) {
	    try {
	    	if(num.length() > 1 && num.substring(0, 1).equals("0")) {
	        	return false;
	        }
	        Integer.parseInt(num);
	        return true;
	        } catch (NumberFormatException e) {
	        return false;
	    }
	}
}
0