Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
红目香薰
My_first_project
提交
43d2fe07
M
My_first_project
项目概览
红目香薰
/
My_first_project
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
My_first_project
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
43d2fe07
编写于
12月 29, 2022
作者:
初学者联盟
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更新叠罗汉4x4/横向叠罗汉.py, 叠罗汉4x4/VIP_module1.py
上级
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
80 addition
and
0 deletion
+80
-0
叠罗汉4x4/VIP_module1.py
叠罗汉4x4/VIP_module1.py
+43
-0
叠罗汉4x4/横向叠罗汉.py
叠罗汉4x4/横向叠罗汉.py
+37
-0
未找到文件。
叠罗汉4x4/VIP_module1.py
0 → 100644
浏览文件 @
43d2fe07
def
MAXorMIN
(
Max_or_Min
:
type
[
str
],
_list
:
type
[
list
])
->
int
|
None
:
try
:
if
Max_or_Min
==
'Max'
:
return
max
(
tuple
(
_list
))
elif
Max_or_Min
==
'Min'
:
return
min
(
tuple
(
_list
))
except
:
return
None
def
str_in_list2int_in_list
(
_list
:
type
[
list
])
->
list
|
None
:
try
:
New_list
=
[]
for
i
in
_list
:
New_list
.
append
(
int
(
i
))
return
New_list
except
:
return
None
def
Tfote
(
_list
:
type
[
list
],
element
)
->
int
|
None
:
for
i
in
range
(
len
(
_list
)):
if
_list
[
i
]
==
element
:
return
i
+
1
break
def
print_xy_list
(
_list
:
type
[
list
])
->
None
:
for
i
in
range
(
len
(
_list
)):
print
(
'第%d行: '
%
(
i
+
1
),
end
=
''
)
for
j
in
_list
[
i
]:
print
(
j
,
end
=
' '
)
print
(
''
)
#print_xy_list([[1,2,3],[2,2,3],[3,2,3]])#实验
#print(MAXorMIN('Min',[23,34,45,12]))#实验
def
_01
(
_int
:
type
[
int
])
->
str
|
None
:
if
_int
<
10
:
return
'0'
+
str
(
_int
)
elif
10
<=
_int
<
100
:
return
str
(
_int
)
\ No newline at end of file
叠罗汉4x4/横向叠罗汉.py
0 → 100644
浏览文件 @
43d2fe07
import
VIP_module1
as
VM
a
=
[[
' '
,
' '
,
' '
,
' '
],[
' '
,
' '
,
' '
,
' '
],[
' '
,
' '
,
' '
,
' '
],[
' '
,
' '
,
' '
,
' '
]]
b
=
[
0
,
0
,
0
,
0
]
c
=
[
'01'
,
'02'
,
'03'
,
'04'
,
'05'
,
'06'
,
'07'
,
'08'
,
'09'
,
'10'
,
'11'
,
'12'
,
'13'
,
'14'
,
'15'
,
'16'
]
z
=
0
while
True
:
z
+=
1
if
c
==
[]:
print
(
'你胜利了,你的结果是:'
)
VM
.
print_xy_list
(
a
)
print
(
'你用了%d次。'
%
z
)
break
d
=
VM
.
MAXorMIN
(
'Min'
,
VM
.
str_in_list2int_in_list
(
c
))
VM
.
print_xy_list
(
a
)
e
=
int
(
input
(
'行数(1~4),要放"'
+
str
(
d
)
+
'": '
))
if
b
[
e
-
1
]
==
0
:
a
[
e
-
1
][
0
]
=
c
[
VM
.
Tfote
(
VM
.
str_in_list2int_in_list
(
c
),
d
)
-
1
]
b
[
e
-
1
]
+=
d
c
.
remove
(
VM
.
_01
(
d
))
else
:
if
b
[
e
-
1
]
<
d
:
for
i
in
a
[
e
-
1
]:
if
i
!=
' '
:
c
.
append
(
i
)
a
[
e
-
1
]
=
[
VM
.
_01
(
d
),
' '
,
' '
,
' '
]
c
.
remove
(
VM
.
_01
(
d
))
b
[
e
-
1
]
=
d
elif
VM
.
Tfote
(
a
[
e
-
1
],
' '
)
==
None
:
print
(
'UNKNOWN ERROR: THE FORMAT IS OUT OF RANGE.'
)
break
else
:
a
[
e
-
1
][
VM
.
Tfote
(
a
[
e
-
1
],
' '
)
-
1
]
=
VM
.
_01
(
d
)
b
[
e
-
1
]
+=
d
c
.
remove
(
VM
.
_01
(
d
))
input
(
''
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录