HDU-1212 Big Number
来源:互联网 发布:apk 反编译 拿到源码 编辑:程序博客网 时间:2024/04/27 23:26
Big Number
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8022 Accepted Submission(s): 5535Problem Description
As we know, Big Number is always troublesome. But it's really important in our ACM. And today, your task is to write a program to calculate A mod B.To make the problem easier, I promise that B will be smaller than 100000.Is it too hard? No, I work it out in 10 minutes, and my program contains less than 25 lines.
Input
The input contains several test cases. Each test case consists of two positive integers A and B. The length of A will not exceed 1000, and B will be smaller than 100000. Process to the end of file.
Output
For each test case, you have to ouput the result of A mod B.
Sample Input
2 312 7152455856554521 3250
Sample Output
251521
Author
Ignatius.L
Source
杭电ACM省赛集训队选拔赛之热身赛
Recommend
Eddy
#include<iostream>#include<cstring>using namespace std;char str[1100];int main(){long m,n,i,j;while(cin>>str){cin>>n;j=strlen(str);m=0;for(i=0;i<j;i++){m=m*10+str[i]-'0';m%=n; }cout<<m<<endl;}return 0;}#include<iostream>#include<cstring>using namespace std;char str[1100];int main(){long m,n,i,j;while(cin>>str){cin>>n;j=strlen(str);m=0;for(i=0;i<j;i++){m=m*10+str[i]-'0';m%=n; }cout<<m<<endl;}return 0;}
0 0
- hdu 1212 Big Number
- HDU 1212 ( Big Number )
- hdu-1212-Big Number
- HDU 1212 Big Number
- HDU 1212 Big Number
- hdu 1212 Big Number
- HDU-1212-Big Number
- hdu 1212 Big Number
- HDU 1212 Big Number
- hdu--1212 Big Number
- HDU 1212 Big Number
- HDU - 1212 Big Number
- HDU 1212 Big Number
- HDU-1212 Big Number
- hdu 1212 Big Number(数论)
- hdu 1212 Big Number(数论)
- HDU 1212 Big Number 【大数】
- HDU-1212-Big Number【大数】
- Linux 内核时钟架构之时钟 tick初始化
- elasticsearch注解作用说明
- 2017Wow!新媒体营销深度分享会最新活动内容
- bash命令之linux下并发运行任务
- Mac电脑快捷键(复制粘贴等)修改
- HDU-1212 Big Number
- 数据库中的BLOB字段--存图片等文件
- 说说 Hibernate 如何映射持久化类
- 自定义View-平滑滚动
- Android帧动画实现,防OOM,比原生动画集节约超过十倍的资源
- Android程序如何在任意处完全退出应用
- POJ1465:Multiple(BFS)
- 史上最全的 Sublime Text 汉化、插件安装合集
- webgis主界面及查询功能实现
原创粉丝点击
热门IT博客
热门问题
老师的惩罚
人脸识别
我在镇武司摸鱼那些年
重生之率土为王
我在大康的咸鱼生活
盘龙之生命进化
天生仙种
凡人之先天五行
春回大明朝
姑娘不必设防,我是瞎子
香菇滑鸡煲仔饭
滑鸡粥
滑溜鸡片
滑鸡的做法
脚滑鸡解说
嫩滑鸡肉丸
虫草花蒸滑鸡
鸡胸脯怎么炒又滑又嫩
黄花菜蒸滑鸡
香菇滑鸡粥的做法
滑炒鸡片正宗做法
清蒸滑鸡的做法大全
蒸滑鸡的做法
香菇滑鸡饭图片
香菇滑鸡的做法
香菇鸡煲仔饭
滑鼠蛇
滑鼠
有线鼠标
鼠标品牌排行榜
鼠标
鼠标什么牌子好
鼠标多少钱
电脑鼠标
鼠标买什么牌子的好
无线鼠标多少钱
鼠标品牌排行
鼠标品牌
鼠标牌子
鼠标吧
鼠标推荐
鼠标图片
鼠标价格
鼠标价格一般多少
滔
滔博
联滔
滔天
不滔
滔组词
滔博运动