1. 程式人生 > >HDU 2075 A|B?

HDU 2075 A|B?

.cn spa In targe AC return 輸出 ane ref

http://acm.hdu.edu.cn/showproblem.php?pid=2075

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 YE NO 代碼:
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int T;
    cin>>T;
    for(int i=1;i<=T;i++)
    {
        int A,B;
        cin>>A>>B;
        if(A%B==0)
            cout<<"YES"<<endl;
        else
            cout<<"NO"<<endl;
    }
    return 0;
}

  

HDU 2075 A|B?