-
Notifications
You must be signed in to change notification settings - Fork 78
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
eee #47
Open
Zxy675272387
wants to merge
20
commits into
luckymark:master
Choose a base branch
from
Zxy675272387:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
eee #47
Changes from 17 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
6348412
Add files via upload
Fuwei-Liu a822d10
Add files via upload
Fuwei-Liu 83bfa0d
Update and rename level1/p01_runningLetter/奔跑的字符.sln to level1/_ P01 …
Fuwei-Liu 6610927
Delete 奔跑的字符.sln
Fuwei-Liu ef4092b
Update 源.cpp
Fuwei-Liu 645b043
Add files via upload
Fuwei-Liu f97e84f
Update 源.cpp
Fuwei-Liu 6dc2d14
Rename 源.cpp to runningLetter
Fuwei-Liu 485c034
Rename 源.cpp to isPrime
Fuwei-Liu ee73bf8
Rename isPrime to isPrime.cpp
Fuwei-Liu f08c9cc
Rename runningLetter to runningLetter.cpp
Fuwei-Liu 2547d6b
Add files via upload
Fuwei-Liu 84f4079
Add files via upload
Fuwei-Liu d4a4de6
Add files via upload
Fuwei-Liu 997b319
Add files via upload
Fuwei-Liu 768678d
Add files via upload
Fuwei-Liu 803dfb0
Add files via upload
Fuwei-Liu 70c4e2b
test
d44d668
qiguai
7fe7da6
yun
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include<stdio.h> | ||
#include<stdlib.h> | ||
#include<windows.h> | ||
int LENGTH = 70; | ||
int main(){ | ||
int k, i = 1, l, p; | ||
while (i++){ | ||
if (i > LENGTH)l = i % LENGTH; | ||
else l = i; | ||
p = i / LENGTH; | ||
if (p % 2 == 0){ | ||
for (k = 1; k < l - 1; k++){ | ||
printf_s(" "); | ||
} | ||
printf_s("->"); | ||
} | ||
if (p % 2 == 1){ | ||
for (k = 1; k < LENGTH - l - 1; k++) { | ||
printf_s(" "); | ||
} | ||
printf_s("<-"); | ||
} | ||
Sleep(50); | ||
system("cls"); | ||
} | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#include<stdio.h> | ||
#include<math.h> | ||
void isPrime(int a){ | ||
int b; | ||
b = int(sqrt(a)); | ||
if (b == 1)printf_s("Yes\n"); | ||
else | ||
for (int i = 2; i <= b; i++){ | ||
if (a % i == 0){ | ||
printf_s("No\n"); | ||
break; | ||
} | ||
else if (i == b)printf_s("Yes\n"); | ||
} | ||
} | ||
int main(){ | ||
int a; | ||
start: | ||
printf_s("请输入一个大于1的整数(输入1退出):"); | ||
scanf_s("%d", &a); | ||
if (a != 1){ | ||
isPrime(a); | ||
goto start; | ||
} | ||
if(a==1) return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include<stdio.h> | ||
int main(){ | ||
float y = 9.000; | ||
while (y+=1){ | ||
float t = y * (1.000 / 6.000 + 1.000 / 12.000 + 1.000 / 7.000) + 9; | ||
if (t * 2== y){ | ||
printf_s("����ͼ��ʱ�������ǣ�%d", int(y)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 文件的编码改为utf-8,这样就不会有乱码了 |
||
break; | ||
} | ||
} | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include<stdio.h> | ||
#include<math.h> | ||
int main(){ | ||
int n, a, b, c; | ||
int m; | ||
for (n = 100; n < 1000; n++){ | ||
a = n / 100; | ||
m = n % 100; | ||
b = m / 10; | ||
c = m % 10; | ||
if (pow(a, 3) + pow(b, 3) + pow(c, 3) == n)printf_s("%d ", n); | ||
} | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include<stdio.h> | ||
int main(){ | ||
int m[1000] = { 0, 2 }; | ||
int i, n = 1; | ||
for (i = 2; i <= 1000; i++){ | ||
for (int k = 1; k <= n; k++){ | ||
if (i % m[k] == 0)break; | ||
else if (k == n){ | ||
n++; | ||
m[n] = i; | ||
printf_s("%d ", i); | ||
} | ||
} | ||
} | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include<stdio.h> | ||
int main() | ||
{ | ||
int x, y; | ||
int p[] = { 0,2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97 }; | ||
bool t; | ||
for (int i = 4; i <= 100; i += 2){ | ||
t = false; | ||
for (x = 1; x <= 25; x++){ | ||
for (y = 1; y <= 25; y++){ | ||
if ((p[x] + p[y]) == i){ | ||
t = true; | ||
break; | ||
} | ||
} | ||
if (t == true)break; | ||
} | ||
if (t == false)printf_s("��°ͺղ�����100���ڲ�����,%d"); | ||
} | ||
if (t == true)printf_s("��°ͺղ�����100���ڳ���"); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include<stdio.h> | ||
#include<conio.h> | ||
char CODE[2][95] = | ||
{{" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~"}, | ||
{"xA.KU2g!OrRyu]p8E;s&1`5HCD{jXlz_}|vo:)Y%f9Bawh $W(\"4cq\*NL-kI/Q?b'J=^d,Z[FGntP+#Vie<>m@TS~70M36"}}; | ||
void func(char c[1000]){ | ||
int i = 0, a, b; | ||
if (c[0] == 'e')a = 0; | ||
if (c[0] == 'd')a = 1; | ||
while (c[i] != '\0'){ | ||
for (int k = 0; k < 95; k++) { | ||
if (c[i] == CODE[a][k]) { | ||
printf_s("%c", CODE[1 - a][k]); | ||
break; | ||
} | ||
} | ||
i++; | ||
} | ||
} | ||
int main() { | ||
int i = 0; | ||
printf_s("�������루��������e��ͷ����������d��ͷ����\n"); | ||
char c[1000] = { '\0' }; | ||
gets_s(c); | ||
func(c); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include<stdio.h> | ||
long int s = 0; | ||
void move(int a, int start, int end) { | ||
if (a == 1) { | ||
printf_s("%d->%d\n", start, end); | ||
s++; | ||
} | ||
else { | ||
move(a - 1, start, 6 - start - end); | ||
printf_s("%d->%d\n", start, end); | ||
s++; | ||
move(a - 1, 6 - start - end, end); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 6-start-end 这个技巧不错,可以抽一个局部变量来存,避免计算两次; |
||
} | ||
} | ||
int main() { | ||
int a; | ||
printf_s("������Ҫ�ƶ��ĸ���"); | ||
scanf_s("%d", &a); | ||
move(a, 1, 2); | ||
printf_s("�ܹ��ƶ�%l��", s); | ||
return 0; | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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循环好点