204公倍數計算

/******
檔名:JPA02.java
題目:TQC+ JAVA6物件導向程式設計 參考答案
時間:2015/06
作者:fang shi mai
******/
import java.util.Scanner;

public class JPA02
{
    static Scanner input = new Scanner(System.in);
    
    public static void main(String[] args)
    {
        test();
        test();
    }
    
    public static void test()
    {
        int N;
        System.out.println("Input:");
        N=input.nextInt();
        
        if(N%5==0 && N%9==0)
            System.out.println("Yes");
        else
            System.out.println("No");
    }
}

沒有留言:

張貼留言