Skip to content

Commit 10aa564

Browse files
Merge pull request #57 from jinwandalaohu66/submission/script_mnbnp2ee
2 parents 6b4a193 + f818d2f commit 10aa564

2 files changed

Lines changed: 79 additions & 2 deletions

File tree

script_library/index.json

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"format_version": 1,
3-
"data_version": 38,
4-
"updated": "2026-03-28T16:01:25.719Z",
3+
"data_version": 39,
4+
"updated": "2026-03-29T11:08:55.169Z",
55
"announcement": null,
66
"categories": [
77
{
@@ -936,6 +936,29 @@
936936
"updated": null,
937937
"status": "active",
938938
"lines": 227
939+
},
940+
{
941+
"id": "script_mnbnp2ee",
942+
"name": "简易数学计算器",
943+
"name_en": "简易数学计算器",
944+
"desc": "小学生做的代码,不喜勿喷,若有bug,及时在电子邮箱里反馈",
945+
"desc_en": "小学生做的代码,不喜勿喷,若有bug,及时在电子邮箱里反馈",
946+
"category": "basic",
947+
"file": "scripts/basic/script_mnbnp2ee.py",
948+
"thumbnail": null,
949+
"version": 1,
950+
"file_type": "py",
951+
"author": "程序员小y",
952+
"author_en": "程序员小y",
953+
"tags": [
954+
"community"
955+
],
956+
"requires": [],
957+
"min_app_version": "1.5.0",
958+
"added": "2026-03-29",
959+
"updated": null,
960+
"status": "active",
961+
"lines": 55
939962
}
940963
]
941964
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
def Menu(): #定义界面
2+
print(('-' * 20))
3+
print('简易数学计算器系统1.0')
4+
print('1.加法运算 2.减法运算 3.乘法运算')
5+
print('4.除法运算 0.退出系统')
6+
print(('-' * 20))
7+
8+
def jia(): #定义加法函数
9+
a = float(input('请输入加数1:'))
10+
b = float(input('请输入加数2:'))
11+
c = a + b
12+
print('和为:',c)
13+
14+
def jian(): #定义减法函数
15+
d = float(input('请输入被减数:'))
16+
e = float(input('请输入减数:'))
17+
f = d - e
18+
print('差为:',f)
19+
20+
def cheng(): #定义乘法函数
21+
g = float(input('请输入乘数1:'))
22+
h = float(input('请输入乘数2:'))
23+
i = g * h
24+
print('积为:',i)
25+
26+
def chu(): #定义除法函数
27+
j = float(input('请输入被除数:'))
28+
k = float(input('请输入除数:'))
29+
l = j / k
30+
print('商为:',l)
31+
32+
def main(): #定义主控制台
33+
while True:
34+
Menu()
35+
key = input('请输入对应功能的数字:')
36+
if key == '1':
37+
jia()
38+
elif key == '2' :
39+
jian()
40+
elif key == '3' :
41+
cheng()
42+
elif key == '4' :
43+
chu()
44+
elif key == '0' :
45+
q = input('是否退出系统?(y or n):')
46+
if q == 'y':
47+
print('已退出系统')
48+
break
49+
else :
50+
print('没有对应此数字的功能!')
51+
52+
main() #调用主函数
53+
54+

0 commit comments

Comments
 (0)