celsius = float(input("请输入一个温度:"))
fathrenheit = (9/5) * celsius + 32
print("所对应的华氏度为:%s" %(fathrenheit))
speed = float(input("请输入飞机起飞速度:"))
acc = float(input("请输入飞机加速度:"))
lth = (speed**2) / (2*acc)
print("所需的最短跑道长度为:%s" %(lth))
num = int(input("请输入一个四位数:"))
print(num%10)
print(num//10%10)
print(num//100%10)
print(num//1000)
import math
(x1,y1,x2,y2,x3,y3) = eval(input("请输入三角形的是三个顶点:"))
side1 = math.sqrt((x1-x2)**2+(y1-y2)**2)
side2 = math.sqrt((x1-x3)**2+(y1-y3)**2)
side3 = math.sqrt((x2-x3)**2+(y2-y3)**2)
s = (side1+side2+side3)/2
area = math.sqrt(s*(s - side1)*(s - side2)*(s - side3))
print("这个三角形的面积为:%f" %area)
import math
s = float(input("请输入一个正六边形的边长:"))
area = (3*math.sqrt(3)/2)*s**2
print("这个六边形的面积为:%s" %(area))
money = float(input("请你输入每月存款:"))
money1 = money * (1+0.00417)
money2 = (money + money1) * (1 + 0.00417)
money3 = (money + money2) * (1 + 0.00417)
money4 = (money + money3) * (1 + 0.00417)
money5 = (money + money4) * (1 + 0.00417)
money6 = (money + money5) * (1 + 0.00417)
print("六个月后的存款数额为%s" %(money6))
money = float(input("请你输入金额:"))
rate = float(input("请你输入年利率:"))
years = float(input("请你输入投资年数:"))
mir = rate/100/12
mon = 12*years
value = money * (1+mir)**mon
print("未来投资额为:%s" %(value))
import math
n = int(input("请输入正多边形的边数:"))
s = float(input("请输入正多边形边的长度:"))
Area = (n*s**2)/(4*math.tan(3.14/n))
print("这个多边形的面积为%s" %(Area))
num = int(input("请输入一个四位整数:"))
num1 = num%10
num2 = num//10%10
num3 = num//100%10
num4 = num//1000
print("各位数字颠倒后的数为:%s" %((num1*1000)+(num2*100)+(num3*10)+num4))
money = float(input("请输入一个十进制带小数点的数字:"))
money = money * 100
nod = money//100
money = money%100
tff = money//25
money = money%25
dime = money//10
money = money%10
nicke = money//5
money = money%5
print("共%s美元,%s个二角五分硬币,%s个一角硬币,%s个五分硬币,%s个一美分硬币" %(nod,tff,dime,nicke,money))
name = str(input("请输入员工姓名:"))
hour = float(input("请输入员工一周工作时间(小时):"))
rate = float(input("请输入员工每小时报酬:"))
fwtr = float(input("请输入联邦预扣税率(三位小数形式):"))
swtr = float(input("请输入州预扣税率(三位小数形式):"))
trate = hour * rate
frate = trate * fwtr
srate = trate * swtr
print("\n")
print("雇员姓名:%s" %(name))
print("一周工作时间:%s" %(hour))
print("每小时报酬:$%s" %(rate))
print("总报酬:$%s" %(trate))
print("预扣金额:")
print("联邦扣税金额(%s%%):$%s" %((fwtr*100),frate))
print("州预扣金额(%s%%):$%s" %((swtr*100),srate))
print("总扣款金额:$%s" %(srate+frate))
print("实收报酬:$%s" %(trate - srate - frate))
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)