if(isPrime(i))
cout<<i<<endl;
//STACK.push(i);
//STACK.pop();
}
DWORD finish=GetTickCount();
cout<<"the cost of time is"<<(finish-start)/1000.0<<endl;
cin>>n;
cin.get();
}
最后运行结果如下:
10000 the cost of time 0.68
1000000 the cost of time 56.551
如果去掉输出语句,1000000的所用时间只有5秒多呀,
我怎么感觉速度还可以把!