-
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
level1_1-6 #27
base: master
Are you sure you want to change the base?
level1_1-6 #27
Conversation
P01_runningletter.c
Outdated
#include<stdio.h> | ||
#include<windows.h> | ||
#define SPACE 50 | ||
void show(char *pos); |
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.
适当加些空行
P02_isprime.c
Outdated
mark = 1; //若被整除,标记mark为1 | ||
break; | ||
} | ||
}if (mark == 1) |
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.
格式有点乱
p05_allPrimes.c
Outdated
for(int i=2;i<=1000;i++) | ||
{ | ||
if (isprinme(i)) | ||
printf("%5d", 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.
加大括号
p05_allPrimes.c
Outdated
#include<stdio.h> | ||
#include<stdlib.h> | ||
#include<time.h> | ||
int isprinme(int a); |
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.
prime拼写错了;P应该大写;
参数名a,不如改为n
} | ||
if (mark == 1) //检查标记 | ||
return 0; | ||
else return 1; |
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.
这里改为?表达式更清真一点(这是我们项目组内部的说法,意思是代码漂亮干净)
if (a == prime[i] + prime[j]) //遍历两个100以内的素数组合之和,与a作比较 | ||
{ | ||
printf("%d满足哥德巴赫猜想\n",a); | ||
goto b; //跳出遍历循环 |
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.
语句标号名取得不太好
p06_Goldbach.c
Outdated
mark = 1; //若被整除,标记mark为1 | ||
break; | ||
} | ||
}if (mark == 1) |
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.
换行,缩进。。。
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.
其实,这里用?表达式也很爽
ret_val = fgets(st, n, stdin); | ||
if (ret_val) | ||
{ | ||
while (st[i] != '\n'&&st[i] != '\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.
加大括号
@@ -0,0 +1,528 @@ | |||
#include<stdio.h> |
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.