-
Notifications
You must be signed in to change notification settings - Fork 35
level_1_p01.c to level_1_p06.c #40
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
Open
Rainbowow
wants to merge
18
commits into
luckymark:master
Choose a base branch
from
Rainbowow: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
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
2681033
Create level_1_p01.c
Rainbowow 4537a75
Create level_1_p02.c
Rainbowow d3ec73b
Create level_1_p03
Rainbowow d255127
Create level_1_p04.c
Rainbowow 8349492
Create level_1_p05.c
Rainbowow f4a5ef9
Create level_1_p06.c
Rainbowow d136750
Rename level_1_p03 to level_1_p03.c
Rainbowow 086e6a6
Update level_1_p05.c
Rainbowow 8c45bee
Update level_1_p04.c
Rainbowow d1fe42d
Update level_1_p05.c
Rainbowow bcb1c1f
Update level_1_p05.c
Rainbowow e08c447
Update level_1_p06.c
Rainbowow 9415fcf
Create level_1_p07.c
Rainbowow 283b692
Create level_1_p08.c
Rainbowow cb5ada2
first four functions
Rainbowow b25197a
limit the border finished
Rainbowow 37bedc5
air game
Rainbowow 75e012f
air game
Rainbowow 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 hidden or 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,21 @@ | ||
| #include<stdio.h> | ||
| #include<windows.h> | ||
| main() | ||
| { | ||
| for(int i=1;i<=50;i++){ | ||
| for(int j=1;j<=i;j++){ | ||
| printf(" "); | ||
| } | ||
| printf("R"); | ||
| Sleep(10); | ||
| system("cls"); | ||
| } | ||
| for(int i=50;i>=1;i--){ | ||
|
Owner
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. 闻到了重复的味道,这两个循环较相似,设法消除之 |
||
| for(int j=i;j>=1;j--){ | ||
| printf(" "); | ||
| } | ||
| printf("R"); | ||
| Sleep(10); | ||
| system("cls"); | ||
| } | ||
| } | ||
This file contains hidden or 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,15 @@ | ||
| #include<stdio.h> | ||
| main() | ||
| { | ||
| int a; | ||
| scanf("%d",&a); | ||
| if(a==1){ | ||
| printf("非素数");} | ||
| for(int i=2;i<=a-1;i++){ | ||
| if(a%i==0){ | ||
| printf("非素数"); | ||
| break;} | ||
| else | ||
| printf("素数"); | ||
| } | ||
| } |
This file contains hidden or 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> | ||
| main() | ||
| { | ||
| int ageDio;int ageSon; | ||
| int i,j; | ||
| for(i=1;i<=100;i++) | ||
| for(j=1;j<=100;j++){ | ||
| ageDio=12*i*7*j; | ||
| ageSon=ageDio/2; | ||
| if(ageSon==((ageDio-4)-(ageDio*11/28+5))){ | ||
| printf("%d",ageDio); | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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> | ||
|
|
||
| main() | ||
| { | ||
| for(int a=1;a<=9;a++) | ||
| for(int b=0;b<=9;b++) | ||
| for(int c=0;c<=9;c++){ | ||
| if(100*a+10*b+c==a*a*a+b*b*b+c*c*c){ | ||
| printf("%d\n",100*a+10*b+c); | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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,25 @@ | ||
| #include<stdio.h> | ||
| #include<time.h> | ||
|
|
||
| int prime(int m) | ||
| { | ||
| for (int i=2;i*i<=m;i++){ | ||
| if(m%i==0) | ||
| {return 0;} | ||
| } | ||
| return 1; | ||
| } | ||
|
|
||
| main() | ||
| { | ||
| double start,finish; | ||
| start=clock(); | ||
| for(int i=2;i<=1000;i++){ | ||
| if(prime(i)>0){ | ||
| printf("%d\n",i); | ||
| } | ||
| } | ||
| finish=clock(); | ||
| printf("\n"); | ||
| printf("%f",finish-start); | ||
| } |
This file contains hidden or 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> | ||
|
|
||
| int checkprime(int m) | ||
| { | ||
| for (int i=2;i*i<=m;i++){ | ||
| if(m%i==0) | ||
| {return 0;} | ||
| } | ||
| return 1; | ||
| } | ||
|
|
||
| int main() | ||
| { | ||
| int a;int prime[100];int control_1=0; | ||
|
|
||
| for(int i=2;i<=100;i++){ | ||
| if(checkprime(i)==1){ | ||
| prime[control_1]=i; | ||
| control_1++; | ||
| } | ||
|
|
||
| } | ||
| for(int i=2;i<=50;i++){ | ||
| for(int j=0;j<=24;j++){ | ||
| a=2*i-prime[j]; | ||
| if(checkprime(a)==1){ | ||
| printf("%d=%d+%d\n",2*i,a,prime[j]);break; | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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> | ||
| #include<string.h> | ||
| main(){ | ||
| char password[1000]; | ||
|
|
||
| scanf("%s",password); | ||
| for(int i=0;i<strlen(password);i++){ | ||
| password[i]+=5; | ||
| } | ||
| printf("%s\n",password); | ||
|
|
||
| for(int i=0;i<strlen(password);i++){ | ||
| password[i]-=5; | ||
| } | ||
| printf("%s\n",password); | ||
| } |
This file contains hidden or 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> | ||
| void hanoi(int n,char a,char b,char c){ | ||
| if(n==1){ | ||
| printf("move plate %d from column %c to column %c\n",n,a,c); | ||
| } | ||
| else{ | ||
| hanoi(n-1,a,c,b); | ||
| printf("move plate %d from column %c to column %c\n",n,a,c); | ||
| hanoi(n-1,b,a,c); | ||
| } | ||
| } | ||
|
|
||
| main(){ | ||
| int n; | ||
| scanf("%d",&n); | ||
| hanoi(n,'A','B','C'); | ||
| } |
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.
加个空行