結果
| 問題 | 
                            No.485 方程式のお勉強
                             | 
                    
| コンテスト | |
| ユーザー | 
                             kamata4mako
                         | 
                    
| 提出日時 | 2017-03-17 00:25:17 | 
| 言語 | Java  (openjdk 23)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 850 bytes | 
| コンパイル時間 | 2,070 ms | 
| コンパイル使用メモリ | 74,812 KB | 
| 実行使用メモリ | 55,888 KB | 
| 最終ジャッジ日時 | 2024-07-04 02:46:52 | 
| 合計ジャッジ時間 | 4,853 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | WA * 4 | 
| other | WA * 13 | 
ソースコード
import java.util.InputMismatchException;
import java.util.Scanner;
public class Main {
	public static int num1;
	public static int num2;
	
	public static void main(String[] args) {
		scanInt();
	}
	
	public static void scanInt(){
		System.out.println("なんか数字2つ入力してみてや");
		Scanner scn = new Scanner(System.in);
		try{
			num1 = scn.nextInt();
			num2 = scn.nextInt();
			ans();
		}catch(InputMismatchException e){
			System.out.println("数字を入力してやあああ#");
		}
	}
	public static void ans(){
		if(waru()){
			System.out.println(answerInt());
		}else{
			System.out.println(answerNo());
		}
	}
	private static boolean waru(){
		if(num1 % num2 == 0){
			return true;
		}return false;
	}	
	
	private static String answerNo(){
		return "NO";
	}
	
	private static int answerInt(){
		return num1 / num2;
	}
}
            
            
            
        
            
kamata4mako