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

智商上的自卑感油然而生

Posted by yzcnyun at 2010-10-18 19:30:46 on Problem 2551
In Reply To:前人好办法。。PF Posted by:taoy at 2007-11-20 21:30:22
#include<stdio.h>
int main()
{
	int n,i,j;
	while(scanf("%d",&n)!=EOF)
	{
		j=1;
		for(i=1;;i++)
		{
			j%=n;
			if(j)
				j=j*10+1;
			else
				break;
		}
		printf("%d\n",i);
	}
	return 0;
}

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