珠海建站服务,潍坊做网站的,php 网站开发的来源,网站有多难做第1关#xff1a;货币转换
#货币换算程序
hl input(请输入汇率)
hb input(请输入带有符号$的货币)
#####代码开始#####hl float(hl)
hb1 float(hb[1:])rmb hb1 * hl
# 输出人民币值
print(人民币#xffe5;{:.2f}.format(rmb))
##…
第1关货币转换
#货币换算程序
hl input(请输入汇率)
hb input(请输入带有符号$的货币)
#####代码开始#####hl float(hl)
hb1 float(hb[1:])rmb hb1 * hl
# 输出人民币值
print(人民币{:.2f}.format(rmb))
####代码结束####第2关黄金价值计算
jgeval(input(黄金价格))
hleval(input(美元汇率))
zleval(input(黄金重量))
#代码开始
jzjg*zl*hl/31.1034768
#代码结束
print(黄金价值{:.2f}.format(jz)) 第3关计算存款复利
# 请在此添加代码
########## Begin ########### 获取用户输入
principal float(input(请输入本金))
interest_rate float(input(请输入年利率))
years int(input(请输入年份))# 计算复利
compound_interest principal * (1 interest_rate / 100) ** years# 输出结果保留两位小数
print(本金利率和为{0:.2f}.format(compound_interest))########## End ##########
第4关求2个数的和
a int(input())
b int(input())
c int(input())# 请在此添加代码交换a、b的值然后计算a、c的和result的值
########## Begin ##########result b c########## End ##########print(result)
第5关出生日期与年龄
# 请在此添加代码
########## Begin ##########
a input()if a[6], and len(a) 8:print(我的出生日期是{}年0{}月0{}日.format(a[0:4],a[5],a[7]))
elif a[7], and len(a) 9:print(我的出生日期是{}年{}月0{}日.format(a[0:4],a[5:7],a[8]))
elif a[6] , and len(a) 9:print(我的出生日期是{}年0{}月{}日.format(a[0:4],a[5],a[7:]))
else:print(我的出生日期是{}年{}月{}日.format(a[0:4],a[5:7],a[8:]))
b 2022-eval(a[0:4])
print(我今年{}岁了.format(b))########## End ##########
第6关逆序数
# 输入一个三位整数
n int(input())# 提取百位、十位和个位数字
hundreds n // 100
tens (n % 100) // 10
units n % 10# 计算逆序数
reversed_number units * 100 tens * 10 hundreds# 输出结果
print(n{0}的逆序数是{1}.format(n, reversed_number))