(1)两点间的距离
# 两点间的距离 #tip1:不使用math库 x1,y1=map(float,input().split()) x2,y2=map(float,input().split()) D = ((x2 - x1)**2 + (y2 - y1)**2)**0.5 print("%.4f"%D) #tip2: 使用math库 from math import sqrt x1,y1 = map(float,input().split()) x2,y2 = map(float,input().split()) D = sqrt((x2 - x1)**2 + (y2 - y1)**2) print("%.4f"%D)
(2)钞票 -顺序结构
N = int(input()) print(N) print("%d nota(s) de R$ 100,00 "%(N // 100)) N %= 100 print("%d nota(s) de R$ 50,00 "%(N // 50)) N %= 50 print("%d nota(s) de R$ 20,00 "%(N // 20)) N %= 20 print("%d nota(s) de R$ 10,00 "%(N // 10)) N %= 10 print("%d nota(s) de R$ 5,00 "%(N // 5)) N %= 5 print("%d nota(s) de R$ 2,00 "%(N // 2)) N %= 2 print("%d nota(s) de R$ 1,00 "%(N // 1))
(3)差
#差-顺序结构 A = int(input()) B = int(input()) C = int(input()) D = int(input()) X =(A * B - C * D) print("DIFERENCA = %d"%X)
(4)工资
#工资 x = int(input()) t = int(input()) S = float(input()) SALARY = float(t * S) print("NUMBER = %d"%x) print("SALARY = U$ %.2f"%SALARY)