标签:
Input
Output
Sample Input
Sample Output
1 #include<iostream> 2 using namespace std; 3 int main() 4 { 5 6 int T; 7 cin >> T; 8 while (T--) 9 { 10 int a, n, m; 11 cin >> m >> n; 12 while ( n >m ? (n %= m) :(m %= n) ); //找公约数是不是1 13 if (n+m==1) 14 cout << "NO" << endl; 15 else 16 cout << "YES" << endl; 17 18 } 19 return 0; 20 }
标签:
原文地址:http://www.cnblogs.com/Lynn0814/p/4738918.html