学习
这是小学奥数题
仔细再看一遍,理解
gaming1990 发表于 2026-4-8 08:57
学习了,第一次见到
尝试一下
import random
numbers =
a,b,c,d,e,f,g,h = (random.choice(numbers) for i in range(8))
if a+b==9 and b+c==8 and c+d==14 and d+e==11 and e+f==3 and f+g==3 and g+h==9 and h+a==13:
print(f"正确:{a}{b}{c}{d}{e}{f}{g}{h}")
else:
print("不正确")
count=0
while True:
count+=1
if e+f==3 and f+g==3 and d+e==11:
print(e,f,g,d)
if d+c==14:
print(d,c)
if c+b==8:
print(c)
if a+b==9:
print(a,b)
if g+h==9 and a+h==13:
print(a,b,c,g,h)
break
else:
h=random.choice()
else:
a=random.choice()
else:
b=random.choice()
else:
c=random.choice()
else:
e=random.choice()
f=random.choice()
g=random.choice()
d=random.choice()
if a+b==9 and b+c==8 and c+d==14 and d+e==11 and e+f==3 and f+g==3 and g+h==9 and h+a==13:
print(f"正确:{a}{b}{c}{d}{e}{f}{g}{h}")
print(count)
else:
print("不正确")
经典题目,学习了
学到了学到了
学到了,我爱学这个
完全没概率,不知道能否用代码实现
又来学习了
我嘞个豆,又学到了
学到了
学习学习,让豆包看看怎么写
原来如此,学到了,学到了
又来了,谢谢
好有趣
学习
{:10_256:}
本帖最后由 magiclpy 于 2026-4-15 13:54 编辑
已知:A+B=9
B+C=8
C+D=14
D+E=11
E+F=3
F+G=3
G+H=9
H+A=13
故 D+E-(E+F)=11-3=8=D-F
故 D=9F=1
推出依次是:63592127
已阅,好难
感觉和数独是不是有关系