开发者

program for all possible arrangements of nxn matrix giving unique sum in c

开发者 https://www.devze.com 2022-12-10 04:56 出处:网络
I want a logic for how to get unique sum like in 3x3 matrix 开发者_如何学Cthe number from 1 to 9 (should not be repeated) the matrix looks like

I want a logic for how to get unique sum like in 3x3 matrix 开发者_如何学Cthe number from 1 to 9 (should not be repeated) the matrix looks like

     4 9 2
     3 5 7
     8 1 6

here the sum is 15.

if i input 3x3 matrix it should return this matrix

please help.


You're thinking of the Magic Square problem, I would guess:

http://pages.prodigy.net/tetrasulfide/magicsquares.html

0

精彩评论

暂无评论...
验证码 换一张
取 消