UVA 10127题目的解答

#include <iostream>
#include <cstdio>
#include <cmath>

int main()
{
int num;

while (scanf_s("%d",&num) != EOF)
{
int cnt = 2;
long long testNum = 11;

while (true)
{
if (testNum%num == 0)
{
break;
}

testNum = testNum * 10 + 1;
cnt++;

}

printf("%d\n",cnt);

}

 

}

posted @ 2016-04-11 12:19  郭新晨  阅读(165)  评论(3编辑  收藏  举报