-
Notifications
You must be signed in to change notification settings - Fork 15
曹思瀚 #7
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
base: main
Are you sure you want to change the base?
曹思瀚 #7
Conversation
| #include <stdio.h> | ||
| #include <windows.h> | ||
|
|
||
| #define RIGHT 00 |
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.
为什么是00不是0呢?有什么特别的讲究吗?
|
|
||
| HANDLE hd; | ||
| int width,dir=RIGHT; | ||
| void move(int x,int y) |
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.
习惯上,我们只在前面写上函数原型,函数实现移到下面
| { | ||
| COORD pos={x,y}; | ||
| SetConsoleCursorPosition(hd,pos); | ||
| return; |
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.
这个return是多余的吧
| CONSOLE_SCREEN_BUFFER_INFO info; | ||
| GetConsoleScreenBufferInfo(hd,&info); | ||
| width=info.srWindow.Right; | ||
| return; |
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 ne(int now) | ||
| { | ||
| if(dir==RIGHT) |
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.
感觉可以简化为一行,反而逻辑更清晰
| now=ne(now); | ||
| move(now,0); | ||
| printf("a"); | ||
| Sleep(25); |
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 sum=0; | ||
| scanf("%d %d",&m,&n); | ||
| if(m==1){ | ||
| m=2;} |
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.
可以格式化一下
| } | ||
| printf("num=%d\n",num); | ||
| int t,k,j,m,n,CNT=0; | ||
| for(t=6;t<=100;t++){ |
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.
感觉逻辑有点乱,不能一目了然
| k=t-a[i]; | ||
| for(j=0;j<num;j++){ | ||
| m=k-a[j]; | ||
| for(n=0;n<num;n++){ |
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.