uva 10127 - Ones(数论)
来源:互联网 发布:淘宝退款骗局处理方法 编辑:程序博客网 时间:2024/05/29 13:57
题目链接:uva 10127 - Ones
题目大意:给出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;}
2 0
- UVA 10127 - Ones(数论)
- 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
- POJ2551 & UVA 10127 Ones (数论) 计算至少要多少位十进制的1能够被n整除
- POJ 2551 Ones(数论)
- Zeros and Ones UVA
- UVa 10127/POJ 2551 Ones (模运算&转换思想)
- UVa:10324 - Zeros and Ones
- UVa -- 10324 Zeros and Ones
- UVa 10324 - Zeros and Ones
- UVA - 10324 Zeros and Ones
- UVa Problem 10127 Ones (仅由 1 组成的数)
- 6步将本地代码上传到github
- svn cleanup failed–previous operation has not finished; run cleanup if it was interrupted
- WindowProc和DefWindowProc的区别
- MyEclipse 2013 优化技巧
- ehcache缓存的详细配置及ehcache.jar下载
- uva 10127 - Ones(数论)
- Mybatis的介绍
- Lucene 3.6.2入门 :HelloWord
- hadoop 3(I/O)
- [ubuntu] sudo:无法解析主机问题
- arp a命令的通俗解释
- Ehcache缓存配置
- 引用的“大概模样”
- 银汇通支付:POS机简介及其分类