how to right a MAGIC SQUARE C-program?要LOAD的..

2007-03-27 5:45 am
唔該哂..我需要框框住d數字..要用2-D array...ONLY單數1,3,5,7,9,11既幻方!

回答 (2)

2007-03-28 12:23 am
✔ 最佳答案
Right or Write ? XDDDD

The most simple way is to use permutations and try-and-error:

- generate all permutations from the numbers you want.
- for each permutation :
- place them in square and test whether it is a magic square
- if it is, return that permutation.

However, there exists more intelligent methods to do it, you can check them in the wiki.
2007-03-30 8:06 am
Do it by yourself 啦~何安婷!!!


收錄日期: 2021-04-23 16:51:02
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20070326000051KK04687

檢視 Wayback Machine 備份