安装 Steam
登录
|
语言
繁體中文(繁体中文)
日本語(日语)
한국어(韩语)
ไทย(泰语)
български(保加利亚语)
Čeština(捷克语)
Dansk(丹麦语)
Deutsch(德语)
English(英语)
Español-España(西班牙语 - 西班牙)
Español - Latinoamérica(西班牙语 - 拉丁美洲)
Ελληνικά(希腊语)
Français(法语)
Italiano(意大利语)
Bahasa Indonesia(印度尼西亚语)
Magyar(匈牙利语)
Nederlands(荷兰语)
Norsk(挪威语)
Polski(波兰语)
Português(葡萄牙语 - 葡萄牙)
Português-Brasil(葡萄牙语 - 巴西)
Română(罗马尼亚语)
Русский(俄语)
Suomi(芬兰语)
Svenska(瑞典语)
Türkçe(土耳其语)
Tiếng Việt(越南语)
Українська(乌克兰语)
报告翻译问题






A = input
B = input
C = 15 - A - B
E = 5
G = 15 - C - E = 10 - C
I = 15 - A - E = 10 - A
D = 15 - A - G
F = 15 - C - I
H = 10 - B
and got 22 / 146 / 50 .
I used two ROMs to store the eight possible magic squares and read them aloud on the go. :)
There is only one 3x3 magic square (and all other magic squares are rotations or reflections). We know first 2 squares (input) and center square (5, never moves).
Knowing that the "magic sum" is always 15 lets us populate a few more numbers. Repeat until we've populated the whole square. This just takes some simple algebra.
After generating a square like this, loop through all digits 1-9, and make sure each digit is present exactly once in the square. This'll tell us that it's the actual magic square. We already know the sums will match, we just need to eliminate square with duplicates or digits outside of [1,9].
Then, just output the square if it's valid, error if not.
Getting all this to fit on the board was not easy. I had to get pretty creative with trace routing!
https://i.imgur.com/YHXSvlp.jpg
https://i.imgur.com/QTB0CuS.jpg
27/1227/65