现在的位置: 首页 > 综合 > 正文

Ones

2013年02月15日 ⁄ 综合 ⁄ 共 222字 ⁄ 字号 评论关闭

http://acm.hust.edu.cn/vjudge/contest/view.action?cid=36366#problem/E

#include<stdio.h>

int main(void)
{
	int n,cnt,tmp;
	
	while(scanf("%d",&n)!=EOF)
	{
		tmp=1;
		cnt=1;
		while(tmp&& n)
		{
			tmp=tmp*10+1;
			++cnt;
			tmp%=n;
		}
		printf("%d\n",cnt);
	}
	return 0;
}

抱歉!评论已关闭.