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 ...
随机推荐
- DP题 总结 [更新中]
建设中 ... 预防针 : 本蒟蒻代码风格清奇(⊙﹏⊙)b 一.选学霸 题目描述 老师想从N名学生中选M人当学霸,但有K对人实力相当,如果实力相当的人中,一部分被选上,另一部分没有,同学们就会抗议.所 ...
- Cocos2d-x 学习笔记(8) ActionManager
1. 概述 ActionManager管理所有的action,调度所有的action,删除指定的action.每个action对应一个node对象,action存储在actions中,actions和 ...
- sql优化提速整理
sql优化提速整理 场景描述 在我们实际开发中,随着业务的不断增加,数据量也在不断的攀升,这样就离不开一个问题:数据查询效率优化 根据自己的以往实际项目工作经验和学习所知,现在对SQL查询优化做一个简 ...
- pycharm在进行debug时不小心把console关闭了,恢复console的办法
点击下图中右边的箭头就恢复了 此时可看到console已恢复
- 后台添加Textbox
/// <summary> /// behind add textbox /// </summary> private void AddTextToTextBox() { Te ...
- @EnableTransactionalManager 发生了什么
@EnableTransactionalManager 利用TransactionManagementConfigurationSelector 给容器中注入bean,导入2个组件: AutoProx ...
- fenby C语言 P23
#include <stdio.h> int main(){ int i,max,a[5]={10,5,20,31,4}; max=a[0]; for(i=0;i<5;i++) if ...
- 如何用好redis pipeline
编者注:pipeline是Redis的一个提高吞吐量的机制,适用于多key读写场景,比如同时读取多个key的value,或者更新多个key的value.工作过程中发现挺多小伙伴都对pipeline多少 ...
- 死磕 java线程系列之线程池深入解析——定时任务执行流程
(手机横屏看源码更方便) 注:java源码分析部分如无特殊说明均基于 java8 版本. 注:本文基于ScheduledThreadPoolExecutor定时线程池类. 简介 前面我们一起学习了普通 ...
- bit(比特)与Byte(字节)的区别与关系
1.bit:位 (小写b) 也称比特 是英文 binary digit的缩写 二进制数系统中,每个0或1就是一个位(bit)位是数据存储(计算机中信息)的最小单位计算机中的CPU位数指的是CPU一次能 ...