C#用程序计算出边长为整数且周长为16的矩形之中面积最大的是正方形

自动化为三维数组设置下标和元素

https://blog.csdn.net/number1killer/article/details/80062718

程序算法之逆推法(猴子摘桃问题正解)

https://blog.csdn.net/number1killer/article/details/78092587



输出:

a=1 b=15; s=15 its[1]=15
a=2 b=14; s=28 its[2]=28
a=3 b=13; s=39 its[3]=39
a=4 b=12; s=48 its[4]=48
a=5 b=11; s=55 its[5]=55
a=6 b=10; s=60 its[6]=60
a=7 b=9; s=63 its[7]=63
a=8 b=8; s=64 its[8]=64
a_b=8
a=9 b=7; s=63 its[9]=63
a=10 b=6; s=60 its[10]=60
a=11 b=5; s=55 its[11]=55
a=12 b=4; s=48 its[12]=48
a=13 b=3; s=39 its[13]=39
a=14 b=2; s=28 its[14]=28
a=15 b=1; s=15 its[15]=15
矩形周长计算完毕,开始对其面积大小进行排序:
64    63    63    60    60    55    55    48    48    39    39    28    28    15   
边长为整数且周长为16的矩形之中最大面积是64,是边长为8的正方形,。


猜你喜欢

转载自blog.csdn.net/number1killer/article/details/80155469