| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
(a+b)%d=(a%d+b%d)%d#include <stdio.h>
int main()
{
int n,i;
long long num;
while(scanf("%d",&n)!=EOF)
{
num=1;
for(i=1;;i++)
{
if(num%n==0)
break;
num=num*10%n+1;
}
printf("%d\n",i);
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator