随笔分类 -  ksxt python课外练习

摘要:样例输入 0.005 样例输出 3.68 样例输入 0.01 样例输出 13.42 解题代码 lev=1.0 count=0 n=float(input()) for i in range(1,366): if count<5: lev*=1+n count+=1 elif count==6: co 阅读全文
posted @ 2022-09-21 17:35 淡淡的晓山横雾 阅读(48) 评论(0) 推荐(0)
摘要:提示 摄氏度=(华氏度-32)/1.8 华氏度=1.8*摄氏度+32 样例输入 50C 样例输出 122.00F 样例输入 50F 样例输出 10.00C 解题代码 str=str(input()) if str[-1]=='C': a=float((str.split('C'))[0])*1.8+ 阅读全文
posted @ 2022-09-21 17:31 淡淡的晓山横雾 阅读(362) 评论(0) 推荐(0)
摘要:样例输入 张三 19 样例输出 张三明年20岁 解题代码 a,b=map(str,input().split()) print(a,"明年",(int(b)+1),"岁",sep='') 阅读全文
posted @ 2022-09-20 22:45 淡淡的晓山横雾 阅读(81) 评论(0) 推荐(0)
摘要:样例输入 2+4j 1+2j 样例输出 (-6+8j) 解题代码 a=complex(input()) b=complex(input()) print(a*b) 阅读全文
posted @ 2022-09-20 22:43 淡淡的晓山横雾 阅读(85) 评论(0) 推荐(0)
摘要:样例输入 2 41 样例输出 02:41 样例输入 12 2 样例输出 12:02 解题代码 a,b=map(int,input().split()) print('{:0>2}:{:0>2}'.format(a,b)) 阅读全文
posted @ 2022-09-20 22:41 淡淡的晓山横雾 阅读(92) 评论(0) 推荐(0)
摘要:提示: 三角形三边(a,b,c)用海伦公式求面积公式如下:L=(a+b+c)/2面积area=(L(L-a)(L-b)(L-c))**0.5 样例输入 3 4 5 样例输出 6.0 样例输入 6 8 10 样例输出 24.0 解题代码 a,b,c=map(int,input().split(" ") 阅读全文
posted @ 2022-09-20 22:38 淡淡的晓山横雾 阅读(768) 评论(0) 推荐(0)
摘要:提示: 计算圆面积公式为area=π*radius*radius,其中π取3.14。 样例输入 2 样例输出 12.56 解题代码 r=float(input()) pi=3.14 k=pi*r*r print('%.2f'%(k)) 阅读全文
posted @ 2022-09-20 22:26 淡淡的晓山横雾 阅读(593) 评论(0) 推荐(0)