Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Level 1 finished #1

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open

Level 1 finished #1

wants to merge 32 commits into from

Conversation

xenoppy
Copy link

@xenoppy xenoppy commented Mar 2, 2021

No description provided.

@xenoppy xenoppy closed this Mar 3, 2021
Copy link
Owner

@luckymark luckymark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

大神动作好快,厉害啊!

@@ -0,0 +1,20 @@
{
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.vscode下的文件一般不用提交到github,可以看看.gitignore的用法: https://docs.github.com/cn/github/using-git/ignoring-files

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好滴,去看看

cin >> x;
if (judge(x))cout << "yes";
else cout << "no"<<endl;
system("pause");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

缩进不对,可以用IDE的自动format处理一下,vs、clion等IDE都有的

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

学到了!!!

int main() {
int x;
cin >> x;
if (judge(x))cout << "yes";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1)if语句的条件判断,和执行分支语句,最好分行写,这样单步跟踪和断点调试的时候更方便
2)Google的编程规范中,分支语句即使只有一行,也要求用大括号抱起来,可以减少一些意外的错误
像这样:

if (judge(x)) {
      cout << "yes";
}

@luckymark luckymark reopened this Mar 9, 2021
@xenoppy xenoppy changed the title the first try of Pull request Level 1 finished Mar 13, 2021
for (unsigned i = 0; i < len; i = i + 1)
{
srand((unsigned)time(NULL));
char a = input[i][0] * 8 + input[(i + 1) % len][0] * 2 + rand() % 2 + 97;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

重复的味道

int hanoi(int n)
{
if (saves[n] == 0)
{
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

啊,是我没写清楚需求,要求打印出移动的步骤,例如:
A->C
A->B
B->C
...

}
void print(int **Maze){
for (int i = 0; i < L; i++) {
for (int j = 0; j < L; j++) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

缩进格数有点不对

level1/p09_maze/source.cpp Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants