#include<stdio.h>
int main()
{
int x;
scanf_s("%d", &x);
int n = 1; //光棍数位数
int s = 1; //a->光棍数
int yu = 0;
while (s < x) {
s = s * 10 + 1;
n++;
}
while (x % 10 != 5 && x % 2 != 0) {
yu = s % x;
printf("%d", s / x); //把一个很大的数按位数拆分
if (yu == 0) { //光棍数是否被整除
break;
}
n++;
s = yu * 10 + 1; //通过余数后添一所构成的新数
}
printf(" %d", n);
return 0;
}
10-25
10-25
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交