#include <iostream>
#include <iomanip>
using std::cout;
using std::cin;
using std::setw;
using std::endl;
int main()
{
const int MAX = 100;
long primes[MAX] = {2,3,5};
long trial = 5;
int count = 5;
bool found = false;
do
{
trial += 2;
found = false;
for(int i ; i < count ; i++ )
{
found = (trial%*(primes + i) == 0);
if(found)
break;
}
if(!found)
*(primes + count++) = trial;
}while(count < MAX);
for(int i = 0; i < MAX; i++ )
{
if(i % 5 == 0)
cout<< endl;
cout<<setw(10)<<*(primes + i);
}
cout << endl;
return 0;
}
编译的时候并没有报错···,只是执行的时候直接停止运行···这是怎么回事·····初始化的事情我之前已经发现了,,初始化之后还是不行··