HDU - 1016 Prime Ring Problem-CSDN博客网友收藏

HDU - 1016 Prime Ring Problem-CSDN博客

#include <iostream>#include <cstring>using namespace std;int arr[25],vis[25],n,cnt;//根据题意,0<n<20,所以开个大小为25的数组即可。bool is_Prime(int x)//判断数x是不是质数{ int k=0; for(int i=2; i<x; i++) { if(x%i==0) { ......
阅读全文