-
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
摸索着交个作业... #45
Open
Flashkong
wants to merge
54
commits into
luckymark:master
Choose a base branch
from
Flashkong: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
摸索着交个作业... #45
Changes from 26 commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
8ae0892
Create C0
Flashkong 0d37b80
Create C1
Flashkong 459abc5
Create p01
Flashkong 5e4c664
Create p02
Flashkong 52e5fc5
Create p04
Flashkong 68ca0ec
Create p05
Flashkong e09e1bf
Rename C0 to helloworld.c
Flashkong 5c26851
Update and rename p02 to p02-isPrime.c
Flashkong 07caa6d
Rename C1 to c1panduanshu.c
Flashkong e73f43b
Rename p04 to p04 shuixianshu.c
Flashkong 3081dd5
Rename p05 to p05-allPrimes.c
Flashkong afdfd69
Create RunningLetter.c
Flashkong bd64562
Create isprime.c
Flashkong 9736e55
Create Diophantus.c
Flashkong 836bce3
Create narcissus.c
Flashkong b961323
Create allPrimers.c
Flashkong a05d35e
Create Goldbach.c
Flashkong 413d81a
Create hanoi.c
Flashkong af0a055
Create maze.c
Flashkong 090a297
Delete p01
Flashkong 77b94ed
Delete p02-isPrime.c
Flashkong e7f3b34
Delete p04 shuixianshu.c
Flashkong 6424039
Delete p05-allPrimes.c
Flashkong 2c66d56
Create PushBoxs.c
Flashkong 494b468
Create linklist.c
Flashkong d7d972a
Create encrypt_decrypt.c
Flashkong a6cdf75
Create Queue.cpp
Flashkong ba7b9ab
Create SafeArry.cpp
Flashkong 6b5d5b1
Change Addback
Flashkong 2fa1034
Updata procedure
Flashkong 1e5c733
Submit Circle and Point
Flashkong 4521c43
submit canvas
Flashkong de09a27
Update Canvas.cpp
Flashkong a2a2752
Update TodoList.md
Flashkong cb402e5
Update TodoList.md
Flashkong 29a043e
Update TodoList.md
Flashkong ca447d6
Update TodoList.md
Flashkong 3d551a1
Create flight.cpp
Flashkong b875fd9
Update flight.cpp
Flashkong a2de511
Update flight.cpp
Flashkong b7193bc
Update TodoList.md
Flashkong 0662574
add one feature
Flashkong 0d37747
achieve bullet and enemy_flight collide
Flashkong daee9de
Update TodoList.md
Flashkong c5d1987
add explotion animation and music
Flashkong 90eb3ba
Update flight.cpp
Flashkong 3e6d9bd
Update README.md
Flashkong 587a0f5
Update README.md
Flashkong 4baf6a0
Create ReadmeFirst
Flashkong be41a2e
Create ReadmeFirst.md
Flashkong b501c1b
Delete flight.cpp
Flashkong ceb67fc
Create TodoList.md
Flashkong 79094cb
Create TodoList.md
Flashkong 6f04154
Create READMEFIRST.md
Flashkong 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,23 @@ | ||
# include <stdio.h> | ||
|
||
int main() | ||
{ | ||
int input; | ||
scanf("%d",&input); | ||
|
||
if(input>0){ | ||
if(input%2==0){ | ||
printf("是正数而且是偶数\n"); | ||
} | ||
else { | ||
printf("是正数但不是偶数\n"); | ||
} | ||
} | ||
else if(input==0){ | ||
printf("既不是正数也不是负数\n"); | ||
} | ||
else{ | ||
printf("是负数\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,8 @@ | ||
# include <stdio.h> | ||
|
||
int main() | ||
{ | ||
printf("Hello World! I'm 李帅锋!\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,26 @@ | ||
# include<stdio.h> | ||
# include<windows.h> | ||
|
||
int main() | ||
{ | ||
int i,j; | ||
for(i=0;i<12;i++){ | ||
for(j=0;j<i;j++){ | ||
printf(" "); | ||
} | ||
Sleep(100); | ||
printf("R"); | ||
system("cls"); | ||
} | ||
|
||
for(i=12;i>0;i--){ | ||
for(j=0;j<i;j++){ | ||
printf(" "); | ||
} | ||
Sleep(100); | ||
printf("R"); | ||
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,23 @@ | ||
# include<stdio.h> | ||
|
||
int main() | ||
{ | ||
int i,x = 0; | ||
int infox=-1; | ||
scanf("%d",&x); | ||
|
||
for( i=2;i<x;i++){ | ||
if(x%i==0){ | ||
infox++; | ||
} | ||
} | ||
|
||
if(infox==-1){ | ||
printf("是素数\n"); | ||
} | ||
else { | ||
printf("不是素数\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,12 @@ | ||
#include <stdio.h> | ||
|
||
int main(void) | ||
{ | ||
int age; | ||
// age/6+age/12+age/7+5 = age-age/2-4 | ||
|
||
age = 28*9/3; | ||
printf("when diophantus's child dead,diophantus was :%d years old.",age-4); | ||
|
||
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,23 @@ | ||
#include <stdio.h> | ||
# include<math.h> | ||
|
||
int main(void) | ||
{ | ||
int shuixianshu; | ||
int baiwei,shiwei,gewei; | ||
|
||
printf("三位水仙数如下:\n"); | ||
|
||
for(int i = 100;i<1000;i++){ | ||
baiwei = i/100; | ||
shiwei = (i%100)/10; | ||
gewei = i%10; | ||
|
||
if(i==pow(baiwei,3)+pow(shiwei,3)+pow(gewei,3)){ | ||
shuixianshu = i; | ||
printf("%d\t",shuixianshu); | ||
} | ||
} | ||
|
||
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,44 @@ | ||
#include <stdio.h> | ||
#include<time.h> | ||
|
||
int isPrimer(int num); | ||
|
||
int main() | ||
{ | ||
clock_t start,finish; | ||
start = clock(); | ||
int primer; | ||
|
||
|
||
for(int i = 2;i<=1000;i++){ | ||
primer = isPrimer(i); | ||
if(primer){ | ||
printf("%d\n",i); | ||
} | ||
} | ||
|
||
printf("the running time is:\t"); | ||
finish = clock(); | ||
double time = (double)(finish-start)*1000/CLOCKS_PER_SEC; | ||
printf("%lf ms",time); | ||
|
||
return 0; | ||
} | ||
|
||
int isPrimer(int num){ | ||
int result = 0; | ||
int cnt = 0; | ||
|
||
for(int i = 2;i<=sqrt(num);i++){ | ||
if(num%i==0) { | ||
cnt++; | ||
break; | ||
} | ||
} | ||
|
||
if(cnt==0){ | ||
result = 1; | ||
} | ||
|
||
return result; | ||
} |
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,52 @@ | ||
#include <stdio.h> | ||
#include<time.h> | ||
|
||
int isPrimer(int num); | ||
|
||
int main() | ||
{ | ||
int primer[25]; | ||
int cnt = 0; | ||
for(int i = 2;i<100;i++){ | ||
if(isPrimer(i)) { | ||
primer[cnt] = i; | ||
cnt++; | ||
} | ||
} | ||
|
||
for(int i=3;i<=100;i++){ | ||
if(i%2==0){ | ||
for(int m = 0;m<=25;m++){ | ||
for(int n = 0;n<=25;n++){ | ||
if(primer[m]+primer[n]==i){ | ||
printf("%d=%d+%d\n",i,primer[m],primer[n]); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
printf("So,we can learn that Goldbach's suspect is right in 0-100.\n"); | ||
return 0; | ||
} | ||
|
||
int isPrimer(int num){ | ||
int result = 0; | ||
int cnt = 0; | ||
|
||
for(int i = 2;i<=sqrt(num);i++){ | ||
if(num%i==0) { | ||
cnt++; | ||
break; | ||
} | ||
} | ||
|
||
if(cnt==0){ | ||
result = 1; | ||
} | ||
|
||
return result; | ||
} | ||
|
||
|
||
|
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 <string.h> | ||
char s[50000]; | ||
void encrypt(); | ||
void decrypt(); | ||
int main() | ||
{ | ||
scanf("%s", s); | ||
encrypt(); | ||
printf("%s\n", s); | ||
decrypt(); | ||
printf("%s\n", s); | ||
return 0; | ||
} | ||
void encrypt() | ||
{ | ||
int i; | ||
for (i = 0; i < strlen(s); i++) | ||
s[i] += 5; | ||
} | ||
void decrypt() | ||
{ | ||
int i; | ||
for (i = 0; i < strlen(s); i++) | ||
s[i] -= 5; | ||
} |
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,28 @@ | ||
# include<stdio.h> | ||
|
||
int i= 0; | ||
|
||
int main() | ||
{ | ||
int N; | ||
printf("input positive integer N: "); | ||
scanf("%d",&N); | ||
|
||
move('a','b','c',N); | ||
|
||
printf("these are all steps!"); | ||
return 0; | ||
} | ||
|
||
void move(char str1,char str2,char str3,int n) | ||
{ | ||
if(n==1){ | ||
printf("the %dst step:\t",++i); | ||
printf("%c->%c\n",str1,str3); | ||
}else{ | ||
move(str1,str3,str2,n-1); | ||
printf("the %dst step:\t",++i); | ||
printf("%c->%c\n",str1,str3); | ||
move(str2,str1,str3,n-1); | ||
} | ||
} |
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,110 @@ | ||
# include<stdio.h> | ||
# include<stdlib.h> | ||
#include <conio.h> | ||
# define SIZE 10 | ||
|
||
int maze[SIZE][SIZE] = { | ||
1,1,1,1,1,1,1,1,1,1, | ||
1, 0, 0, 0, 1, 0, 1, 1, 0, 1, | ||
1, 0, 1, 0, 0, 0, 1, 0, 0, 1, | ||
1,0,0,1,0,1,1,1,0,1, | ||
1,1,0,1,0,1,0,0,1,1, | ||
1,0,0,1,0,0,0,1,0,1, | ||
1,1,0,0,1,1,1,0,0,1, | ||
1,1,1,0,0,0,1,1,0,1, | ||
1,0,0,0,1,0,0,0,0,1, | ||
1,1,1,1,1,1,1,1,1,1 | ||
|
||
}; | ||
|
||
void begin() | ||
{ | ||
printf("this is a small maze game\n"); | ||
printf("please enter any key to continue..."); | ||
getchar(); | ||
system("cls"); | ||
for (int i = 0; i < 40; i++) { | ||
printf("Maze generation..."); | ||
system("cls"); | ||
} | ||
} | ||
|
||
void show_maze(int prex,int prey,char c,int cnt) | ||
{ | ||
system("cls"); | ||
int i, j; | ||
|
||
for ( i = 0; i < SIZE; i++) { | ||
for ( j = 0; j < SIZE; j++) { | ||
if (maze[i][j]==1) printf("%c%c", 0xa8, 0x80); | ||
else if (i == prey&&j == prex) printf("**"); | ||
else printf(" "); | ||
if (j == SIZE - 1) printf("\n"); | ||
} | ||
} | ||
if (cnt) { | ||
printf("You can't head to a wall!!\n"); | ||
} | ||
} | ||
|
||
int ifhead(int *nowx, int *nowy,char c) | ||
{ | ||
if (maze[*nowy][*nowx] == 1) { | ||
|
||
switch (c) | ||
{ | ||
case 72: | ||
*nowy += 1; | ||
break; | ||
case 75: | ||
*nowx += 1; | ||
break; | ||
case 80: | ||
*nowy -= 1; | ||
break; | ||
case 77: | ||
*nowx -= 1; | ||
break; | ||
} | ||
return 1; | ||
} | ||
return 0; | ||
} | ||
|
||
int main() | ||
{ | ||
int k = 0, cnt = 0; | ||
int nowx = 1, nowy = 1; | ||
begin(); | ||
show_maze(1,1,0,cnt); | ||
|
||
while (1) { | ||
char c = _getch(); | ||
|
||
switch (c) | ||
{ | ||
case 72: | ||
nowy -= 1; | ||
break; | ||
case 75: | ||
nowx -= 1; | ||
break; | ||
case 80: | ||
nowy += 1; | ||
break; | ||
case 77: | ||
nowx += 1; | ||
break; | ||
} | ||
cnt = ifhead(&nowx, &nowy, c); | ||
show_maze(nowx, nowy, c,cnt); | ||
|
||
if (nowx == SIZE - 2 && nowy == SIZE - 2) { | ||
printf("Congratulations,You have passed this game!\n"); | ||
break; | ||
} | ||
} | ||
|
||
system("pause"); | ||
return 0; | ||
} |
Oops, something went wrong.
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.
这个不行哦