#include <bits/stdc++.h>
using namespace std;
void main()
{
int i, j;
for (i = 2; i < 100;i++) {
for (j = 2; j <= (int)sqrt(i); ++j) if (i % j == 0)break;
if (j >= (int)sqrt(i) + 1)cout << i << endl;
}
}
C++检索小于k的所有素数
最新推荐文章于 2021-04-07 19:53:35 发布