uva 10127 - Ones(数论)
2015-02-17 13:11
567 查看
题目链接:uva 10127 - Ones
题目大意:给出n,问说者少要多少为1才干够整除n。
解题思路:等于是高精度取模,直到余数为0为止。
题目大意:给出n,问说者少要多少为1才干够整除n。
解题思路:等于是高精度取模,直到余数为0为止。
#include <cstdio> #include <cstring> int main () { int n; while (scanf("%d", &n) == 1) { int ans = 1, c = 1; while (c) { c = (c * 10 + 1) % n; ans++; } printf("%d\n", ans); } return 0; }
相关文章推荐
- UVA 10127 Ones (数论) 计算至少要多少位十进制的1能够被n整除
- UVA 10127 - Ones(数论)
- 【数论,水题】UVa 10127 - Ones
- UVA 10127 - Ones(数论)
- uva 10127 - Ones(数论)
- UVA-10127 Ones (数论)
- uva 10127 - Ones
- UVa Problem Solution: 10127 - Ones
- uva 10127 Ones
- UVa Problem 10127 Ones (仅由 1 组成的数)
- UVa 10127 - Ones
- UVa 10127/POJ 2551 Ones (模运算&转换思想)
- UVa:10127 Ones
- uva 10127——ones
- UVA - 10127 Ones
- UVA——10090(数论之线性方程)(挑战编程题目)
- UVA 10622 Perfect P-th Powers(数论)
- uva 10104 Euclid Problem (数论-扩展欧几里德)
- UVa 138 Street Numbers(数论&Pell方程)
- UVA 11728 - Alternate Task (数论)