HDOJ 2075 A|B?

Problem Description
正整数A是否能被正整数B整除,不知道为什么xhd会研究这个问题,来帮帮他吧。

Input
输入数据的第一行是一个数据T,表示有T组数据。
每组数据有两个正整数A和B(A,B<10^9)。

Output
对于每组输入数据,输出”YES”表示可以被整除,”NO”表示不能被整除。

Sample Input
2
4 2
5 3

Sample Output
YES
NO

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        while(n-->0){
            int a = sc.nextInt();
            int b = sc.nextInt();
            if(a%b==0){
                System.out.println("YES");

            }else{
                System.out.println("NO");
            }


        }

    }

}
原文地址:https://www.cnblogs.com/webmen/p/5739424.html