#include <stdio.h>
#include <stdlib.h>
int main()
{
int a,b,p,c,count,t,flag;
while(1)
{
scanf("%d",&p);
c=0;
count=0;
flag=1;
while(c!=0||flag!=0)
{
a=c*10+1;
c=a%p;
b=a/p;
count++;
if(b==0&&flag==1) continue;
printf("%d",b);
flag=0;
}
printf(" %d\n",count);
}
return 0;
}
AOJ 778
最新推荐文章于 2022-03-02 01:01:33 发布