結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー YamaKasaYamaKasa
提出日時 2018-05-24 23:41:05
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 661 bytes
コンパイル時間 2,099 ms
コンパイル使用メモリ 71,448 KB
実行使用メモリ 56,080 KB
最終ジャッジ日時 2023-09-11 03:03:45
合計ジャッジ時間 5,054 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,504 KB
testcase_01 AC 119 ms
55,688 KB
testcase_02 AC 121 ms
55,284 KB
testcase_03 AC 122 ms
55,600 KB
testcase_04 AC 121 ms
55,548 KB
testcase_05 AC 121 ms
55,560 KB
testcase_06 WA -
testcase_07 AC 125 ms
55,592 KB
testcase_08 WA -
testcase_09 AC 124 ms
55,884 KB
testcase_10 AC 121 ms
55,416 KB
testcase_11 AC 119 ms
55,636 KB
testcase_12 AC 120 ms
55,272 KB
testcase_13 AC 120 ms
55,724 KB
testcase_14 AC 120 ms
55,216 KB
testcase_15 AC 120 ms
55,736 KB
testcase_16 AC 120 ms
56,080 KB
権限があれば一括ダウンロードができます

ソースコード

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