nyoj 103-A+B Problem II (python 大数相加)
103-A+B Problem II
内存限制:64MB
时间限制:3000ms
特判: No
通过数:10
提交数:45
难度:3
题目描述:
I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B.
A,B must be positive.
输入描述:
The first line of the input contains an integer T(1<=T<=20) which means the number of test cases. Then T lines follow, each line consists of two positive integers, A and B. Notice that the integers are very large, that means you should not process them by using 32-bit integer. You may assume the length of each integer will not exceed 1000.
输出描述:
For each test case, you should output two lines. The first line is "Case #:", # means the number of the test case. The second line is the an equation "A + B = Sum", Sum means the result of A + B. Note there are some spaces int the equation.
样例输入:
2
1 2
112233445566778899 998877665544332211
样例输出:
Case 1:
1 + 2 = 3
Case 2:
112233445566778899 + 998877665544332211 = 1111111111111111110
python AC:
n = int(input())
for i in range(1, n + 1): # 默认从0开始,后面那个数为不包括的数
a, b = map(int, input().split()) # 实现两个值在同一行输入
print("Case %d:" % i)
print("%d + %d = %d" % (a, b, a + b))
i += 1
nyoj 103-A+B Problem II (python 大数相加)的更多相关文章
- nyoj 103 A + B problem II
点击打开链接 A+B Problem II 时间限制:3000 ms | 内存限制:65535 KB 难度:3 描述 I have a very simple problem for you. G ...
- HDU 1002:A + B Problem II(大数相加)
A + B Problem II Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) ...
- 杭电 1002 A + B Problem II【大数相加】
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1002 解题思路:就是把大的数用数组存放起来,像小学的时候用竖式加法来算两个数相加那样算: 反思:思路很 ...
- A + B Problem II(大数加法)
http://acm.hdu.edu.cn/showproblem.php?pid=1002 A + B Problem II Time Limit: 2000/1000 MS (Java/Other ...
- HDU 1023 Train Problem II (大数卡特兰数)
Train Problem II Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) ...
- HPU 1002 A + B Problem II【大数】
A + B Problem II Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) ...
- nyoj 623 A*B Problem II(矩阵)
A*B Problem II 时间限制:1000 ms | 内存限制:65535 KB 难度:1 描述 ACM的C++同学有好多作业要做,最头痛莫过于线性代数了,因为每次做到矩阵相乘的时候,大 ...
- hdoj 1002 A + B Problem II【大数加法】
A + B Problem II Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) ...
- HDU 1002 A + B Problem II (大数加法)
题目链接 Problem Description I have a very simple problem for you. Given two integers A and B, your job ...
随机推荐
- spring源码系列7:Spring中的InstantiationAwareBeanPostProcessor和BeanPostProcessor的区别
概念 Bean创建过程中的"实例化"与"初始化"名词 实例化(Instantiation): 要生成对象, 对象还未生成. 初始化(Initialization ...
- Halcon一日一练:图像分割之基本概念
1.什么是图像分割: 图像分割就是把图像中特定的目标提出来,进行处理. 2.为什么要做图像分割: 图像分割是由图像处理到图像分析的关键步骤,准确的来说,没有图像分割,图像处理将无法实现其后续的操作.进 ...
- Spring Boot 2.X(十):自定义注册 Servlet、Filter、Listener
前言 在 Spring Boot 中已经移除了 web.xml 文件,如果需要注册添加 Servlet.Filter.Listener 为 Spring Bean,在 Spring Boot 中有两种 ...
- WPF使用border画框
以前的界面中使用的框大都是由美工做好的,但是这样就遇到几个问题: 框只是换一个颜色,就需要多做出一张图,资源包中也要多一个图片资源: 文字的数量会改变,用一张固定的图进行拉伸,边角处会变得越来越不尽如 ...
- 开源造轮子:一个简洁,高效,轻量级,酷炫的不要不要的canvas粒子运动插件库
一:开篇 哈哈哈,感谢标题党的莅临~ 虽然标题有点夸张的感觉,但实际上,插件库确实是简洁,高效,轻量级,酷炫酷炫的咯.废话不多说,先来看个标配例子吧: (codepen在线演示编辑:http://co ...
- ExtJs 扩展类CheckColumn修改源码,支持按条件禁用启用下拉框功能
长话短说,具体的请看图 需求如图: 修改CheckColumn.js源码,添加鼠标点击改变事件 完整JS脚本 Ext.ns('Ext.ux.grid'); Ext.ux.grid.CheckColum ...
- Eureka和zookeeper的比较
什么是CAP? CAP原则又称CAP定理,指的是在一个分布式系统中,Consistency(一致性). Availability(可用性).Partition tolerance(分区容错性),三者不 ...
- 让SpringBoot的jackson支持JavaBean嵌套的protobuf
问题背景 REST 项目使用protobuf 来加速项目开发,定义了很多model,vo,最终返回的仍然是JSON. 项目中一般使用 一个Response类, public class Respons ...
- C和C++引用传递和数组传参引用
引用传递有两种传参方式,具体可参考文章 概括地讲,就是 *声明一个形参是指针,所以需要传递指针实参,对应的函数实现也应当遵循指针的语法.这种实现思路并不针对于C或者C++,因为它们都有指针,所以都可以 ...
- CentOS 7 的root口令破解两种方法
破解CentOS7的root口令 方法一: 第一步: 启动时任意键暂停启动 按-e-键进入编辑模式 第二步: 1.将光标移动至蓝框处linux16开头的行,添加内核参数 rd.break 2.按ctr ...