判斷素數的兩種方法

方法一:ios #include<iostream> #include<cmath> using namespace std; int sushu(int x) { int t = 0; for (int i = 2; i <= sqrt(x); i++) { if (x % i == 0) t++; if (t == 0) return 1; else
相關文章
相關標籤/搜索