x,y =input().split()
x =int(x)
y =int(y)print(x + y)
P0020:字符三角形
a =input()print(" "*2+ a)print(" "+ a*3)print(a*5)
P0030:计算(a+b)*c的值
s =input().split()# 计算表达式的值
result =(int(s[0])+int(s[1]))*int(s[2])# 输出结果print(result)
P0040:反向输出一个三位数
# 获取输入的三位数
n =int(input())# 分别获取百位、十位、个位数字
a = n //100
b =(n //10)%10
c = n %10# 反向输出数字print(f"{
c}{
b}{
a}")
P0050:字符菱形
c =input()print(" "+ c)print(" "+ c + c + c)print(c *5)print(" "+ c*3)print(" "*2+ c)
P0060:输出第二个整数
s =input().split()#split()遇到空格进行切分,生成列表形式的元素print(s[1])#通过元素下标取第二个元素(下标为1)
P0070:求三个数的和总
s =input().split()#将用户输入的数通过空格进行切分,形成列表#将字符串转换成数值,进行下一步的运算#因为此处元素均为字符串,+号在此处代表连接符print(float(s[0])+float(s[1])+float(s[2]))#通过float()方法,将字符串转换成浮点数
P0080:字符串交换
#有两行输入,需要用两个input()方法进行接收
a =input()
b =input()#通过元素下标取字符串中的字符print(b[0]+ b[1]+ a[2]+ a[3])print(a[0]+ a[1]+ b[2]+ b[3])
P0090:字符串中的整数求和
s =input().split()
a, b = s[0], s[1]print(int(a[0]+ a[1])+int(b[0]+ b[1]))'''
s = input().split() #['12B', '34D']
#通过元素下标取出每一个元素,然后将字符串中的前两个元素取出,通过int()方法转换成整数进行运算
#将字符串转换成数值
print(int(s[0][0] + s[0][1]) + int(s[1][0] + s[1][1]))
'''
P0094:输出个人信息
name =input()
age =int(input())
height =float(input())print(f"I am {
name}.I am {
age} years old and I am {
height:.3f}m tall.")
P0100:求(x+y)*x的值
x, y =map(float,input().split())
result =(x + y)* x
print(f"{
result:.5f}")
P0110:奇偶数判断
n =int(input())if n %2==1:print("odd")else:print("even")
P0120:判断子串
a =input()
b =input()if a in b:print("YES")else:print("NO"
P0130:三角形判断
a, b, c =map(int,input().split())if(a + b > c)and(a + c > b)and(b + c > a):print("yes")else:print("no")
P0140:简单计算器
num1, num2, op =list(input().split())
num1 =int(num1)
num2 =int(num2)if op =='+':
res = num1 + num2
elif op =='-':
res = num1 - num2
elif op =='*':
res = num1 * num2
elif op =='/':if num2 ==0:
res ='Divided by zero!'else:
res = num1 // num2
else:
res ="Invalid operator!"print(res)
P0150:摄氏华氏温度转换
eps =1e-6
temp =input()if temp[-1]in['F','f']:
c =(float(temp[0:-1])-32)/1.8ifabs(c -round(c))< eps:print("%dC"%round(c))else:print("%.2fC"% c)elif temp[-1]in"Cc":
f =1.8*eval(temp[0:-1])+32ifabs(f -round(f))< eps:print("%dF"%round(f))else:print("%.2fF"% f)
P0160:幸运的年份
year =int(input())if year <0:print("Illegal year")elif(year -1949)%10==0and(year -1949)>=0:print("Lucky year")elif(year -1921)%10==0and(year -1921)>=0:print("Good year")elif(year %400==0)or((year %4==0)and(year %100!=0)):print("Leap year")else:print("Common year")
P0170:计算 2 的幂
n =int(input())#接收用户的输入,并转换成整数if n >=0and n <31:#判断n的取值是否满足条件范围print(2** n)#**号代表次方运算
P0180:计算多项式的值
s =input().split()#['2.31', '1.2', '2', '2', '3']#将x,a,b,c,d分别取出,然后转换成浮点数等待下一步运算
x =float(s[0])
a =float(s[1])
b =float(s[2])
c =float(s[3])
d =float(s[4])print("%.7f"%(a*(x**3)+ b*(x**2)+ c*x + d))#格式化输出,通过“%.7f”实现结果保留小数点后7位
P0190:车牌限号
s =input()ifint(s[-1])%2:print("YES")else:print("NO")
s =input()#接收用户输入的车牌号#取元素下标,从左往右从0开始,从左往右递增的;从右往左是从-1开始,从右往左递减ifint(s[-1])%2==1:#判断最后一位是否为奇数print("YES")else:print("NO")
P0200:点和正方形的关系
s =input().split()
x =float(s[0])
y =float(s[1])if(x >=-1and x <=1)and(y >=-1and y <=1):print("yes")else:print("no")
P0210:计算邮资
t =input().split()
a =int(t[0])
b = t[1]if a <=1000:
cost =8else:#(a-1000) % 500 != 0 结果是boolean值,和数值进行运算时,对应true = 1 false = 0
cost =8+((a-1000)//500+((a-1000)%500!=0))*4if b =="y":
cost +=5print(cost)
t =input().split()#切分出用户输入的邮件重量和是否选择加急
a =int(t[0])#将用户输入的第一个数转换成数值,进行后续运算
b = t[1]
cost =0#将邮费赋初值0if a <=1000:
cost =8else:if(a -1000)%500==0:#判断超重部分是否为500的整倍数
cost =8+4*(a -1000)//500else:
cost =8+4*((a -1000)//500+1)# 如果超重部分对500不能整除,结果向上取整if b =='y':#判断是否进行加急
cost = cost +5print(cost)
P0220:分段函数
x =float(input())if0<= x <5:print("%.3f"%(-x +2.5))elif5<= x <10:print("%.3f"%(2-1.5*(x-3)*(x-3)))else:print("%.3f"%( x/2-1.5))
x =float(input())#将用户输入的内容转换成浮点数if x >=0and x <20:#先判断x取值是否在[0,20)区间内,在的话参与后续运算,不在,没有任何后续运算,程序直接结束if x >=0and x <5:#判断x是否在第一分段
y =-x +2.5elif x >=5and x <10:#判断x是否在第二分段
y =2-1.5*(x-3)*(x-3)else:#不在第一、二分段,肯定在第三分段
y = x/2-1.5print("%.3f"%y)
P0240:苹果和虫子
lst =input().split()
n, x, y =int(lst[0]),int(lst[1]),int(lst[2])
n -=(y // x)+(y % x !=0)if n <0:
n =0print(n)
s =input().split()
n =int(s[0])#一箱的好苹果数量
x =int(s[1])#虫子吃掉一个苹果所需时间
y =int(s[2]<