博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
杭电1212--Big Number
阅读量:5942 次
发布时间:2019-06-19

本文共 1352 字,大约阅读时间需要 4 分钟。

Big Number

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)

Total Submission(s): 5961    Accepted Submission(s): 4167

Problem 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 3
12 7
152455856554521 3250
 

 

Sample Output
2
5
1521
 

 

Author
Ignatius.L
 

 

Source
 

 

Recommend
Eddy   |   We have carefully selected several similar problems for you:            
 
//··A``
1 #include 
2 #include
3 char str[1010] ; 4 int main() 5 { 6 int i, n ; 7 while(~scanf("%s %d", str, &n)) 8 { 9 int mod = 0 ;10 int len = strlen(str) ;11 for(i = 0; i < len; i++)12 mod = (mod * 10 + str[i] - '0') % n ;13 printf("%d\n", mod) ;14 }15 return 0 ; 16 }

 

 

转载于:https://www.cnblogs.com/soTired/p/4674708.html

你可能感兴趣的文章
innerHTML outerHTML innerText
查看>>
kafka安装教程
查看>>
go语言基础
查看>>
LINQ to SQL活学活用(1):这要打破旧观念
查看>>
Spring boot 嵌入的tomcat不能启动: Unregistering JMX-exposed beans on shutdown
查看>>
【Windows】字符串处理
查看>>
Spring(十八):Spring AOP(二):通知(前置、后置、返回、异常、环绕)
查看>>
CentOS使用chkconfig增加开机服务提示service xxx does not support chkconfig的问题解决
查看>>
微服务+:服务契约治理
查看>>
save
查看>>
Android DrawLayout + ListView 的使用(一)
查看>>
clear session on close of browser jsp
查看>>
asp.net mvc Post上传文件大小限制 (转载)
查看>>
关于吃掉物理的二次聚合无法实现的需要之旁门左道实现法
查看>>
mysql出现unblock with 'mysqladmin flush-hosts'
查看>>
oracle exp/imp命令详解
查看>>
开发安全的 API 所需要核对的清单
查看>>
Mycat源码中的单例模式
查看>>
WPF Dispatcher介绍
查看>>
fiddler展示serverIP方法
查看>>