-
Notifications
You must be signed in to change notification settings - Fork 33
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
大神动作好快,厉害啊!
.vscode/launch.json
Outdated
@@ -0,0 +1,20 @@ | |||
{ |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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都有的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
学到了!!!
level1/p02_isPrime/source.cpp
Outdated
int main() { | ||
int x; | ||
cin >> x; | ||
if (judge(x))cout << "yes"; |
There was a problem hiding this comment.
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";
}
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; |
There was a problem hiding this comment.
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) | ||
{ |
There was a problem hiding this comment.
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
...
level1/p09_maze/source.cpp
Outdated
} | ||
void print(int **Maze){ | ||
for (int i = 0; i < L; i++) { | ||
for (int j = 0; j < L; j++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
缩进格数有点不对
No description provided.