代码:
cel = int(input("请输入摄氏温度:"))
fa = (9/5) * cel + 32
print(cel,"摄氏度的华氏度为:",fa)
执行框图:
代码:
import sys
import math
radius = float(input("请输入圆柱的半径:"))
height = float(input("请输入圆柱的高:"))
area = radius*radius*math.pi
volume = area * height
print(area)
print(volume)
执行框图:
代码:
a = int(input("请输入一个0-1000整数:"))
if a>=100 and a<=1000:
num = a%10 + (a//10)%10 + ((a//10)%10)%10
print(num)
else:
num = a%10 + (a//10)%10
print(num)
执行框图:
代码:
minitue = int(input('输入分钟数:'))
minitues = 365 * 24 * 60
year = int(minitue/minitues)
day = int(minitue%minitues/60/24)
print('%s 分钟有 %s年 %s 天'%(minitue, year, day))
执行框图:
代码:
M = float(input("请加入一千克为计量的水:"))
fir = float(input("初始温度:"))
fin = float(input("最终温度:"))
Q = M*(fin-fir)*4184
print("最终消耗能量为:",Q)
代码:
tem = float(input("请输入在华氏度-58到41的温度:"))
speed = float(input("请输入2里/时以上的风速:"))
tw = 35.74 + 0.6215*tem - 35.75*(speed**0.16) +0.4275*tem*(speed**0.16)
print("风寒温度:",tw)
执行框图:
代码:
v = float(input("请输入起飞速度速度:"))
a = float(input("请输入加速度:"))
length = (v**2)/(2*a)
print("最短跑道长度为:",length)
执行框图:
代码:
num = int(input("请输入一个四位整数:"))
a = num%10
b = (num%100)//10
c = (num%1000)//100
d = num//1000
print(a)
print(b)
print(c)
print(d)
执行框图:
代码:
import math
x1,y1 = eval(input("请输入顶点1:"))
x2,y2 = eval(input("请输入顶点2:"))
x3,y3 = eval(input("请输入顶点3:"))
side1 = math.sqrt((x1-x2)**2+(y1-y2)**2)
side2 = math.sqrt((x1-x3)**2+(y1-y3)**2)
side3 = math.sqrt((x3-x2)**2+(y3-y2)**2)
s = (side1 + side2 + side3) / 2
area = math.sqrt(s*(s-side1)*(s-side2)*(s-side3))
print("面积为:",area)
执行框图:
代码:
import math
a = float(input("请输入正六边形的边长:"))
s = (3*math.sqrt(3)/2)*(a**2)
print("面积为:",s)
执行框图:
代码:
money = float(input('输入存款:'))
a = 1
apl = 0.00417
Sum = money * (1 + apl)
while a >= 1 and a < 6 :
Sum = (money+Sum) * (1 + apl)
a = a+1
print('总钱:',Sum)
执行框图:
代码:
money = int(input("存多少钱:"))
lilv = float(input("年利率:"))
year = int(input("年数为:"))
sum = money*((1+(lilv/1200))**(year*12))
print(sum)
执行框图:
代码:
import math
a,b,c = eval(input("请输入三条边长:"))
A = math.acos((a*a-b*b-c*c)/(-2*b*c))
B = math.acos((b*b-a*a-c*c)/(-2*a*c))
C = math.acos((c*c-b*b-a*a)/(-2*a*b))
print(A)
print(B)
print(C)
执行框图:
代码:
import math
s = float(input("请输入边长:"))
n = float(input("有多少边:"))
Area = n*(s**2)/(4*math.tan(math.pi/n))
print(Area)
执行框图:
代码:
num = int(input("请输入一个四位整数:"))
a = num%10
b = num//10%10
c = num//100%10
d = num//1000%10
sum = a*1000+b*100+c*10+d
print(sum)
执行框图:
代码:
num = float(input("请输入钱数:"))
a = num*100
b = a//100
c = a%100
d = c//25
e = c%25
f = e//10
g = e%10
h = g//5
i = g%5
print("分数为:",a)
print("美元个数为:",b)
print("两角五分个数为:",d)
print("一角硬币个数为:",f)
print("五分硬币个数为:",h)
print("一美分硬币个数为:",i)
执行框图:
代码:
name = input("姓名:")
time = float(input("一周工作时间:"))
money = float(input("每小时报酬:"))
tr = float(input("联邦预扣税率:"))
tr1 = float(input("州预扣税率:"))
a = time*money
b = a*tr
c = a*tr1
d = b+c
e = a-d
print("姓名:",name)
print("工作时长:",time)
print("每小时报酬:",money)
print("总计报酬:",a)
print("扣税及实发工资如下:")
print("联邦预扣税钱:",b)
print("州预扣税钱:",c)
print("总计扣税钱:",d)
print("实发工资:",e)
执行框图: