Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson5_2
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1282aa77
authored
Feb 27, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
9f6c1ac4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
13 deletions
diy4.py
diy6.py
diy4.py
View file @
1282aa77
whille
True
:
i
=
input
(
"你要输几位数?(2~4位都可以哦!)"
)
if
i
==
"两位数 "
or
"2位数"
:
j
=
int
(
input
(
"乘数1是什么?"
))
k
=
int
(
input
(
"乘数2是什么?"
))
d
=
(
j
*
k
)
print
(
j
,
'*'
,
k
,
'='
,
d
)
elif
i
==
"三位数 "
or
"3位数"
:
j
=
int
(
input
(
"乘数1是什么?"
))
k
=
int
(
input
(
"乘数2是什么?"
))
d
=
(
j
*
k
)
print
(
j
,
'*'
,
k
,
'='
,
d
)
while
True
:
i
=
input
(
"你要输几位数?(2~4位都可以哦!)"
)
if
i
==
"两位数 "
or
"2位数"
:
j
=
int
(
input
(
"乘数1是什么?"
))
k
=
int
(
input
(
"乘数2是什么?"
))
d
=
(
j
*
k
)
print
(
j
,
'*'
,
k
,
'='
,
d
)
elif
i
==
"三位数 "
or
"3位数"
:
j
=
int
(
input
(
"乘数1是什么?"
))
k
=
int
(
input
(
"乘数2是什么?"
))
e
=
int
(
input
(
"乘数3是什么?"
))
d
=
(
j
*
k
*
e
)
print
(
j
,
'*'
,
k
,
'*'
,
e
,
'='
,
d
)
elif
i
==
"四位数 "
or
"4位数"
:
j
=
int
(
input
(
"乘数1是什么?"
))
k
=
int
(
input
(
"乘数2是什么?"
))
e
=
int
(
input
(
"乘数3是什么?"
))
a
=
int
(
input
(
"乘数4是什么?"
))
d
=
(
j
*
k
*
e
*
a
)
print
(
j
,
'*'
,
k
,
'*'
,
e
,
'*'
,
a
,
'='
,
d
)
else
:
print
(
"请重新输入"
)
\ No newline at end of file
diy6.py
0 → 100644
View file @
1282aa77
i
=
1
for
j
in
range
(
1
,
10
):
prin
(
j
,
'*'
,
k
,
'='
,
j
*
i
,
end
=
" "
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment