#include<iostream>
#include<iomanip>
#include<vector>
#include<string>
#include<cmath>
using namespace std;
int main()
{
int x = 0;
int s = 0;
for (int i = 100; i <= 200; i++)
{
for (int j = 1; j <= i; j++)
{
if (i % j == 0)
{
x += 1;
}
}
if (x == 2)
{
s += 1;
}
x = 0;
}
cout << s << endl;
for (int i = 100; i <= 200; i++)
{
for (int j = 1; j <= i; j++)
{
if (i % j == 0)
{
x += 1;
}
}
if (x == 2)
{
cout << i << " ";
}
x = 0;
}
return 0;
}
c++素数
最新推荐文章于 2024-08-18 17:42:33 发布