【Light】[1078]Integer Divisibility
来源:互联网 发布:淘宝兄弟体育是正品么 编辑:程序博客网 时间:2024/06/05 08:46
这一题的题意是
如输入 3 1
则要求输出最少有
几个1 组成的数字能被3整数
如 111能被3整除
则输出 3
同理
对于 7 3
则 333333能被7整除
则输出6
运用同余定理
AC代码如下
#include<stdio.h>int main() { int T,n,m,k,r; int i; scanf("%d",&T); for(i=1; i<=T; i++) { scanf("%d %d",&n,&m); r=m%n; k=1; while(r) { r=(r*10+m)%n; k++; } printf("Case %d: %d\n",i,k); } return 0;}
题目地址:【Light】[1078]Integer Divisibility
0 0
- 【Light】[1078]Integer Divisibility
- light--oj--1078 - Integer Divisibility
- Light OJ 1078:Integer Divisibility
- light oj 1078 - Integer Divisibility
- light oj 1078 - Integer Divisibility
- Light 1078 Integer Divisibility (取模运算)
- Light OJ 1078:Integer Divisibility【数学】
- Light 1078 Integer Divisibility (取模运算)
- Light OJ 1078:Integer Divisibility【数学】
- light oj 1078 - Integer Divisibility【同余定理】
- light oj 1078 - Integer Divisibility (取模运算)
- Light Oj 1078 Integer Divisibility(同余定理)
- Light OJ Integer Divisibility 【取模】
- LIGHTOJ-1078 - Integer Divisibility
- LightOJ-1078 Integer Divisibility
- 1078 - Integer Divisibility
- 【Light-oj】-Integer Divisibility(同余定理)
- 【light oj1078】Integer Divisibility(同余定理)
- C++抽象类
- LT29i刷机方法
- 算法设计题2.39~2.40-线性表-第2章-《数据结构习题集》-严蔚敏吴伟民版
- THREEJS阴影效果
- 递归之---汉诺塔
- 【Light】[1078]Integer Divisibility
- Pillow-PIL的完全Fok替代库--完美解决报错The _imagingft C module is not installed的解决方案
- MyBatis学习总结(一)——MyBatis快速入门(转发)
- JSON 字符串转换为 JavaScript 对象
- QT QSplitter随窗口自适应大小(Autosize)
- getchar() 与getch()
- 【重走普及路】【贪心】合并果子
- JSP指令与动作元素
- 浅谈递归