帮我在c ++中用数字1-9构建一个魔术方阵。 [英] Help me build a magic square with numbers 1-9 in c++.

查看:150
本文介绍了帮我在c ++中用数字1-9构建一个魔术方阵。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我完全迷失了。我需要帮助建立一个魔术方块,最多可以添加15个列和行。我将需要询问用户输入的数字1-9并回答它是否是一个魔方。请帮助。



我尝试了什么:



i我坚持开始时。我想到了一切,但只是不知道从哪里开始。这是我的第一个任务,我需要你的帮助。谢谢

i am totally lost. i need help building a magic square that add up to 15 all columns and rows. i will need to ask for the users input in the numbers 1-9 and reply with if its a magic square or not. PLEASE HELP.

What I have tried:

i am stuck to the begining. i thought about everything but just dont know where to begin. this is my first assignment and i need your help. thank you

推荐答案

在如何创建魔术方块方面,用铅笔和纸制作逻辑,然后尝试编写应用程序。



如果这是你的第一份作业,那么你应该做的工作。

请不要让别人为你做这件事。



最后,如果您要求帮助,请准备好展示您已经完成的工作,特别是您需要帮助的地方。
In terms of how to create the magic square, work out the logic with pencil and paper, then try to write the application.

If this is your first assignment, then you are expected to do the work.
Please do not ask someone else to do it for you.

Finally, if you are going to ask for help, be prepared to show what you've already done and, specifically, where you need help.

您必须为初学者学习编程,最好是谷歌的一些 Youtube教程。做一些饮料和吃东西,看几个小时学习。玩得开心;-)



要获得解决方案,第一步是将您的任务分解为更小的可解决步骤。第一步通常是要求用户输入 AND 检查它是否有效。就像在这个 I / O教程中描述的那样。
You must learn programming, at best Google for some Youtube tutorials for beginners. Make some drinks and something to eat and watch for some hours to learn. Have a good time ;-)

To get a solution the first step is to break down your task into smaller solvable steps. The first step is usually to ask the user for input AND check it for valid values. Like in this I/O tutorial described.


引用:

我坚持到了开头。我想到了一切,但只是不知道从哪里开始。

i am stuck to the begining. i thought about everything but just dont know where to begin.



我忍不住,但这让我想到了这样的事情:

我想建立在我家后院的航天飞机,但我不知道从哪里开始。

这是一个提示,你没有该项目的基本知识。



建议:学习编程。

以下是语言作者对C和C ++参考书的链接。注意,C是C ++的祖先,所以知道C对C ++总是有用。

C编程语言 - 维基百科,免费的百科全书 [ ^ ]

https://hassanolity.files.wordpress.com/2013/11/the_c_programming_language_2。 pdf [ ^ ]

http://www.ime.usp。 br / ~pf / Kernighan-Ritchie / C-Programming-Ebook.pdf [ ^ ]



C ++编程语言 [ ^ ]


I can't help but this makes me think to something like:
I want to build a space shuttle in my backyard, but I don't know where to start.
It is a hint that you don't have the basic knowledge for the project.

Advice: Learn programming.
Here is links to references books on C and C++ by the authors of the languages. Note than C is the ancestor of C++, so knowing C is always useful with C++.
The C Programming Language - Wikipedia, the free encyclopedia[^]
https://hassanolity.files.wordpress.com/2013/11/the_c_programming_language_2.pdf[^]
http://www.ime.usp.br/~pf/Kernighan-Ritchie/C-Programming-Ebook.pdf[^]

C++ Programing Language[^]


这篇关于帮我在c ++中用数字1-9构建一个魔术方阵。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆