-
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
作业 #15
base: master
Are you sure you want to change the base?
作业 #15
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.
厉害啊,加油
} | ||
while (i >= 0) | ||
{ | ||
for (int j = 0; j < i; ++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.
重复的味道,试着消除吧
level1/p02_isPrime/isPrime.cpp
Outdated
int n = 0; | ||
scanf_s("%d", &n); | ||
int Isprime = 1; | ||
for (int j = 2; j <= n / 2; 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.
提成一个函数更舒服一点
level1/p02_isPrime/isPrime.cpp
Outdated
{ | ||
printf("%d������", n); | ||
} | ||
if (Isprime == 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.
可以改为 else
level1/p02_isPrime/isPrime.cpp
Outdated
} | ||
else | ||
{ | ||
if (Isprime == 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 (IsPrime) 更像老手一点
No description provided.