标签:
最大公约数
Description
Input
Output
Sample Input
Sample Output
#include <iostream>
#include <cstdio>
using namespace std;
unsigned int gcd(unsigned int a,unsigned int b)
{
return b==0? a:gcd(b,a%b);
}
int main()
{
int t;
unsigned int m,n;
scanf("%d",&t);
while(t--)
{
scanf("%u%u",&m,&n);
if(gcd(m,n)==1)
printf("NO\n");
else
printf("YES\n");
}
return 0;
}
标签:
原文地址:http://www.cnblogs.com/xl1164191281/p/4748679.html