GCD的运用
#include <cstdio> #include <cstring> #include <iostream> using namespace std; int Gcd(int x,int y){ if(y == 0)return x; else return Gcd(y,x % y); } int main(){ int n; scanf("%d",&n); while(n--){ int x,y; scanf("%d%d",&x,&y); int s = Gcd(x,y); if(s == 1)printf("NO\n"); else printf("YES\n"); } return 0; }