HDU2012 素數判定

#include <iostream> #include <cstdio> #include <cmath> using namespace std; bool IsPrime(int x) { int len = (int)sqrt(x); for(int i=2; i<=len; i++) { if(x%i == 0) return false; } return tr
相關文章
相關標籤/搜索