hdoj 2075 A|B?

A|B?

Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 18491    Accepted Submission(s): 14035


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
 
Author
xhd
 
//水题,嗯嗯~ o(* ̄▽ ̄*)o
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {    
        Scanner cin = new Scanner(System.in);
        int n = 0 ;    
        n = cin.nextInt(); 
        while( n-- > 0 ){
            int x = 0, y = 0;
            x = cin.nextInt();
            y = cin.nextInt();
            if( x%y == 0) 
                System.out.println("YES");
            else
                System.out.println("NO");
        }
    }
}
 
原文地址:https://www.cnblogs.com/upstart/p/6066908.html