题解 | 小红的合数寻找
小红的合数寻找
https://www.nowcoder.com/practice/2a35a6306f204ea3ab76ff10d188ff9e
直接遍历范围内的所有数然后逐一判断即可。
x=int(input())
a=0
for i in range(x,2*x+1):
if i%2==0 and i>2:
print(i)
a=1
break
if a==0:
print(-1)
#牛客春招刷题训练营#
查看11道真题和解析