Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

跪求各位大牛,那些20K左右memory的C/C++是怎么做的?

Posted by xiao1590 at 2007-02-19 22:53:46 on Problem 2551
好多题都见到占好少内存的程序,不知道他们怎么做到的?
#include <iostream>

using namespace std;

void main()
{
	unsigned n,a,i;
	while (cin>>n)
	{
		for (i=1,a=1;a%n;i++)
		{
			a=(a%n*10)+1;
		}
		cout<<i<<endl;
	}
}
我这程序只定义3个变量,实在想不明白再怎么少了
菜鸟,各位毋见笑!

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator