1-引入

先来看一道题:

如果 a+b+c=1000,且 a^2+b^2=c^2(a,b,c 为自然数),如何求出所有a、b、c可能的组合?

最基本的, 我们采用枚举法, 三层循环遍历a, b, c就能写出来

Last updated

Was this helpful?