-
Notifications
You must be signed in to change notification settings - Fork 35
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_p01.c to level_1_p06.c #40
base: master
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,21 @@ | |||
#include<stdio.h> | |||
#include<windows.h> | |||
main() |
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.
加个空行
Sleep(10); | ||
system("cls"); | ||
} | ||
for(int i=50;i>=1;i--){ |
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 a,b,c,result;int i; | ||
for(a=1;a<=9;a++) | ||
for(b=0;b<=9;b++) | ||
for(c=0;c<=9;c++){ |
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 i,j; | ||
for(i=2;i<=1000;i++){ | ||
if(prime(i)>0) | ||
printf("%d\n",i); |
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("%d\n",i); | ||
} | ||
printf("\n"); | ||
printf("%d",(int)clock()); |
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 k;int i; | ||
k=sqrt(m); | ||
for (i=2;i<=k;i++) | ||
if (m%i==0) break; |
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 k;int i; | ||
k=sqrt(m); | ||
for (i=2;i<=k;i++) | ||
if (m%i==0) break; |
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.