题解 | 单组_spj判断YES与NO
单组_spj判断YES与NO
https://www.nowcoder.com/practice/4dffedb2a0734a0e9ce759f2eaeeda65
n = int(input())
if(n%2):print("YES")
else:print("NO")
我第一次这么写的,但看了题解想起来python可以写为行表达式
后面改成print("YES" if n%2 else "NO")
单组_spj判断YES与NO
https://www.nowcoder.com/practice/4dffedb2a0734a0e9ce759f2eaeeda65
n = int(input())
if(n%2):print("YES")
else:print("NO")
我第一次这么写的,但看了题解想起来python可以写为行表达式
后面改成print("YES" if n%2 else "NO")
相关推荐