結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー nullzine
提出日時 2017-01-13 18:03:02
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 739 bytes
コンパイル時間 2,113 ms
コンパイル使用メモリ 74,616 KB
実行使用メモリ 54,300 KB
最終ジャッジ日時 2024-12-21 12:01:48
合計ジャッジ時間 4,758 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 11 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

/**
 * Created by nullzine on 2017/01/13.
 */
public class Main {

    public static void main(String[] args){
        System.out.println(new Main().run());
    }

    private String run(){
        Scanner sc = new Scanner(System.in);
        int aa,bb;
        String a,b;
        a = sc.nextLine();
        b = sc.nextLine();
        if(zeroValidation(a)||zeroValidation(b)){
            return "NG";
        }
        try{
            aa=Integer.parseInt(a);
            bb=Integer.parseInt(b);
        }catch(NumberFormatException e){
            return "NG";
        }
        return "OK";
    }

    private boolean zeroValidation(String str){
        return !str.equals("0")&&str.charAt(0)=='0';
    }

}
0