-
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
2017.03.11 #51
Open
RainforZurich
wants to merge
20
commits into
luckymark:master
Choose a base branch
from
RainforZurich: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
2017.03.11 #51
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
93305cd
adasd
1aa1699
add a new file
372b91f
2017.3.8
8b7997f
2017 3 9
81ee9f7
2017.03.10
f4ce25e
2017.03.11
b5bdf98
2017.03.11(2)
b6f5aa2
2017.03.11(3)
2c8d0d2
2014.03.11(4)
2bee969
2017.03.11(5)
90f5561
2017.3.14
477e42f
2017.3.15
b014d22
2017.4.6
4250509
123
af6a450
new
386a0c5
new
0e51e76
new
8915fb1
new
75b8c67
new
68e5295
new
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,34 @@ | ||
/* system("color 0a"); | ||
while(1){ | ||
printf("0 1"); | ||
*/ | ||
#include<stdio.h> | ||
#include<Windows.h> | ||
int main() | ||
{ | ||
system("color 0a"); | ||
|
||
int i,j; | ||
|
||
while(1){ | ||
for(i = 0 ; i < 49 ; i++){ | ||
for(j = 0 ; j < i ; j++){ | ||
printf(" "); | ||
} | ||
printf("R"); | ||
system("cls"); | ||
} | ||
for(i = 49 ; i > -1 ; i--){ | ||
for(j = i ; j > -1 ; j--){ | ||
printf(" "); | ||
} | ||
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,19 @@ | ||
#include<stdio.h> | ||
int main() | ||
{ | ||
int a,n = 0; | ||
|
||
scanf("%d",&a); | ||
for(int i = 2 ; i < a ; i++){ | ||
if(a%i == 0){ | ||
n = 1; | ||
} | ||
} | ||
if(n == 0){ | ||
printf("yes"); | ||
}else{ | ||
printf("no"); | ||
} | ||
|
||
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,17 @@ | ||
//����ͼ��ͯ�꾭������һ��������֮һ�����꾭����ʮ����֮һ�������߷�֮һ��ʱ���ǵ������� | ||
//����������˸����ӣ����ӱȸ����������꣬�꼶������һ�롣�ʶ�����ʱ����ͼ��� | ||
#include<stdio.h> | ||
int main() | ||
{ | ||
int a; | ||
for(a = 60 ; a < 150 ; a++){ | ||
if(a%6 == 0){ | ||
if(a%12 == 0){ | ||
if(a%7 == 0){ | ||
printf("%d\n",a); | ||
} | ||
} | ||
} | ||
} | ||
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,18 @@ | ||
#include<stdio.h> | ||
main() | ||
{ | ||
printf("��λ����ˮ����Ϊ:\n"); | ||
for(int a = 100 ; a < 1000 ; a++) | ||
{ | ||
int hun = a/100; | ||
int ten = a/10-hun*10; | ||
int one = a-hun*100-ten*10; | ||
|
||
if(a == hun*hun*hun+ten*ten*ten+one*one*one) | ||
{ | ||
printf("%d\t",a); | ||
} | ||
|
||
} | ||
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,30 @@ | ||
/* | ||
1. ��ӡ2-1000���ڵ��������� | ||
2. ��ӡ���ܵļ���ʱ�� | ||
3. �������Ż��㷨��Ч�� | ||
*/ | ||
#include<stdio.h> | ||
#include<time.h> | ||
#include<Windows.h> | ||
int main() | ||
{ | ||
system("color 0a"); | ||
clock_t t1 = clock(); | ||
for(int a = 2 ; a < 999 ; a++){ | ||
int n = 0; | ||
for(int i = 2 ; i < a ; i++){ | ||
if(a%i == 0){ | ||
n = 1; | ||
break; | ||
} | ||
} | ||
if(n == 0){ | ||
printf("%d\t",a); | ||
|
||
} | ||
} | ||
clock_t t2 = clock(); | ||
|
||
printf("\nTime=%d",t2-t1); | ||
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,40 @@ | ||
#include<stdio.h> | ||
|
||
bool isPrimes(int n); | ||
|
||
int main() | ||
{ | ||
int m,n; | ||
int num = 0; | ||
|
||
for(int i = 2 ; i < 98 ; i = i+2){ | ||
for(n = 1 ; n < i ; n++){ | ||
|
||
int truth = 0; | ||
m = i-n; | ||
|
||
if(isPrimes(n)&&isPrimes(m)){ | ||
truth = 1; | ||
if(truth == 1){ | ||
num++; | ||
break; | ||
} | ||
} | ||
|
||
} | ||
} | ||
if(num == 48){ | ||
printf("this propersition is right"); | ||
} | ||
return 0; | ||
} | ||
|
||
bool isPrimes(int n) | ||
{ | ||
for(int i = 2 ; i < n ; i++){ | ||
if(n%i == 0){ | ||
return false; | ||
} | ||
} | ||
return true; | ||
} |
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,66 @@ | ||
#include<stdio.h>//?������ | ||
|
||
void decrypt(); | ||
void encrypt(); | ||
|
||
int main() | ||
{ | ||
int choice; | ||
printf("Would you want to decrypt(1) or encrypt(2)?"); | ||
scanf("%d",&choice); | ||
if(choice==1){ | ||
decrypt(); | ||
}else{ | ||
encrypt(); | ||
} | ||
return 0; | ||
} | ||
|
||
|
||
void encrypt() | ||
{ | ||
int n,j=0; | ||
char ch[80],tran[80]; | ||
printf("input cipher code:"); | ||
gets(ch); | ||
printf("\ncopher code :%s",ch); | ||
for(j;ch[j]!='\0'; j++){ | ||
if((ch[j]>='A')&&(ch[j]<='Z')){ | ||
tran[j]=155-ch[j]; | ||
}else if((ch[j]>='a')&&(ch[j]<='z')){ | ||
tran[j]=219-ch[j]; | ||
}else { | ||
tran[j]=ch[j]; | ||
} | ||
n=j; | ||
printf("\noriginal text:"); | ||
for(j=0;j<n;j++){ | ||
putchar(tran[j]); | ||
} | ||
} | ||
} | ||
|
||
void decrypt() | ||
{ | ||
int n,j=0; | ||
char ch[80],tran[80]; | ||
printf("input original code:"); | ||
gets(ch); | ||
printf("\noriginal code :%s",ch); | ||
for(j;ch[j]!='\0'; j++){ | ||
if((ch[j]>='A')&&(ch[j]<='Z')){ | ||
tran[j]=155-ch[j]; | ||
}else if((ch[j]>='a')&&(ch[j]<='z')){ | ||
tran[j]=219-ch[j]; | ||
}else { | ||
tran[n]=ch[j]; | ||
} | ||
n=j; | ||
printf("\ncipher text:"); | ||
for(j=0;j<n;j++){ | ||
putchar(tran[j]); | ||
} | ||
} | ||
|
||
} | ||
|
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,31 @@ | ||
#include<stdio.h> | ||
|
||
void hanoi(int n,char a,char b,char c); | ||
void move(char x,char y); | ||
|
||
int main() | ||
{ | ||
int m; | ||
printf("input the number of diskes:"); | ||
scanf("%d",&m); | ||
hanoi(m,'A','B','C'); | ||
|
||
return 0; | ||
} | ||
|
||
|
||
void hanoi(int n,char a,char b,char c) | ||
{ | ||
if(n==1){ | ||
move(a,c); | ||
}else{ | ||
hanoi(n-1,a,c,b); | ||
move(a,c); | ||
hanoi(n-1,b,a,c); | ||
} | ||
} | ||
|
||
void move(char x,char y) | ||
{ | ||
printf("%c-->%c\n",x,y); | ||
} |
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 |
---|---|---|
@@ -1,7 +1,20 @@ | ||
### 题目:迷宫小游戏(基于console) | ||
|
||
### 功能要求: | ||
|
||
1. 在控制台上显示一个迷宫,包括:墙、玩家、出口等; | ||
2. 通过上下左右键,控制玩家行走; | ||
3. 当玩家到达出口,则显示玩家赢得了游戏; | ||
### 题目:迷宫小游戏(基于console) | ||
|
||
### 功能要求: | ||
|
||
1. 在控制台上显示一个迷宫,包括:墙、玩家、出口等; | ||
2. 通过上下左右键,控制玩家行走; | ||
3. 当玩家到达出口,则显示玩家赢得了游戏; | ||
|
||
|
||
0 0000000000000000 | ||
0 0 | ||
00 000000000000000 | ||
0 0 | ||
000 00000000000000 | ||
0 0 | ||
0000 0000000000000 | ||
0 0 | ||
00000 000000000000 | ||
0 0 | ||
000000 00000000000 |
Binary file not shown.
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.
main函数也需要返回类型