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

level1_1-6 #27

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

level1_1-6 #27

wants to merge 29 commits into from

Conversation

Philosjay
Copy link

No description provided.

#include<stdio.h>
#include<windows.h>
#define SPACE 50
void show(char *pos);
Copy link
Owner

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)
Copy link
Owner

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);
Copy link
Owner

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);
Copy link
Owner

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;
Copy link
Owner

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; //跳出遍历循环
Copy link
Owner

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)
Copy link
Owner

Choose a reason for hiding this comment

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

换行,缩进。。。

Copy link
Owner

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')
Copy link
Owner

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>
Copy link
Owner

Choose a reason for hiding this comment

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

哇,很想看看这个程序的运行效果!

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