跳到正文

题解

题解:P13006 【MX-X13-T1】「KDOI-12」在现实和志向中选择现实,否则会一个都得不到的。

EricWan约 1 分钟
原文
文章信息与版本

文章信息

发布
2025年6月29日
收录
2025年12月12日
更新
2026年10月27日
篇幅
约 1 分钟
获赞
5
题目
P13006

版本

  1. v1当前

梦熊的 T1 总是让 Python 专业对口。Python 的 string 有成员方法 split() 为按空格分隔,存储入 5 个变量再判一下就秒了,注意不要少打句点。

至于抉择,喜欢用分支的用分支:

Python
a, b, c, d, e = input().split()
if a == c and e == 'weak.' :
    print('Plang.');
else :
    print('Not plang.')

想少打字的用即时生成的列表:

Python
a, b, c, d, e = input().split()
print(['Not plang.', 'Plang.'][a == c and e == 'weak.'])
原文