HDUOJ2075:A|B?

版权声明:qq836678589 https://blog.csdn.net/weixin_43924623/article/details/90317953

A|B?
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 29116 Accepted Submission(s): 21552

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

#include<iostream>
#include<cstring>
using namespace std;
int main(){
	int n,a,b;
	cin>>n;
	while(n--){
		cin>>a>>b;
		if(a%b==0)
		cout<<"YES"<<endl;
		else
		cout<<"NO"<<endl; 
	}
	return 0;
} 

猜你喜欢

转载自blog.csdn.net/weixin_43924623/article/details/90317953
今日推荐