zl程序教程

您现在的位置是:首页 >  其它

当前栏目

蓝桥杯每日一练:A+B问题

蓝桥 每日 问题
2023-09-14 09:14:35 时间

一、题目

问题描述
  Given two integers A and B, your task is to output their sum, A+B.
输入格式
  The input contains of only one line, consisting of two integers A and B. (0 ≤ A,B ≤ 1 000)
输出格式
  The output should contain only one number that is A+B.
样例输入
1 1
样例输出
2

二、代码

a,b=map(int,input().split())  # 将输入的数字转化为int类型
print(a+b)

运行:
在这里插入图片描述
也可以:

a=int(input())
b=int(input())
print(a+b)

运行:
在这里插入图片描述

三、视频讲解

蓝桥杯比赛python组视频教程