From 5b8009598d3f5e3fb1496285be978a420fee1a28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=92=90=E7=86=99?= <15741786+wang-luxii@user.noreply.gitee.com> Date: Mon, 21 Apr 2025 06:32:19 +0000 Subject: [PATCH] =?UTF-8?q?add=2020240200554=E7=8E=8B=E7=92=90=E7=86=99.tx?= =?UTF-8?q?t.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王璐熙 <15741786+wang-luxii@user.noreply.gitee.com> --- ...4\347\216\213\347\222\220\347\206\231.txt" | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 "20240200554\347\216\213\347\222\220\347\206\231.txt" diff --git "a/20240200554\347\216\213\347\222\220\347\206\231.txt" "b/20240200554\347\216\213\347\222\220\347\206\231.txt" new file mode 100644 index 0000000..4760e7e --- /dev/null +++ "b/20240200554\347\216\213\347\222\220\347\206\231.txt" @@ -0,0 +1,36 @@ +""" +将华氏温度转换为摄氏温度 + +Version: 0.1 +Author: 王璐熙 +""" + +f = float(input('请输入华氏温度: ')) +c = (f - 32) / 1.8 +print('%.1f华氏度 = %.1f摄氏度' % (f, c)) +""" +输入半径计算圆的周长和面积 + +Version: 0.1 +Author: 王璐熙 +""" + +import math + +radius = float(input('请输入圆的半径: ')) +perimeter = 2 * math.pi * radius +area = math.pi * radius * radius +print('周长: %.2f' % perimeter) +print('面积: %.2f' % area) +""" +输入年份 如果是闰年输出True 否则输出False + +Version: 0.1 +Author: 王璐熙 +""" + +year = int(input('请输入年份: ')) +# 如果代码太长写成一行不便于阅读 可以使用\对代码进行折行 +is_leap = (year % 4 == 0 and year % 100 != 0) or \ + year % 400 == 0 +print(is_leap) \ No newline at end of file -- Gitee