求阶乘之和的后六位--

#include 
#include 
#include 


using namespace std;
int main()
{
	timeval tv_start,tv_end;
	gettimeofday(&tv_start,0);
	// 为了不让键盘等待时间影响计时,如果输入较少,使用管道来输入
	//	echo 20 | ./a.out
	
	//如果输入较多,可以使用重定向来输入。 编译时需带上 -DLOCAL
#ifdef LOCAL
	if(!freopen("input.txt","r+",stdin)) //将stdin重定向到input.txt
	{
		perror("freopen");
	}
	if(!freopen("output.txt","w+",stdout)) //将stdout 重定向到output.txt
	{
		perror("freopen2");
	}
#endif

	const int MOD = 1000000;
	int i , j ,n ,s = 0;
	cout << i << " " << j << " " << n << endl;
	//使用优化选项  -O1 或者 02 03时,i,j,n的值都被编译器设为0,而不是随机的大数
	cin >> n;
	if(n > 25) //优化,大于25以上到阶乘 后六位都是0 
	{
		n = 25;
	}
	for(i=1;i

你可能感兴趣的:(求阶乘之和的后六位--)