-
Notifications
You must be signed in to change notification settings - Fork 35
交作业 #25
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
TGWarwolf
wants to merge
40
commits into
luckymark:master
Choose a base branch
from
TGWarwolf: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
交作业 #25
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
74ad321
Create running_letter
TGWarwolf 7f4a9ad
Delete running_letter
TGWarwolf c72b671
Create Running letter
TGWarwolf 1a0cb3a
完成了running letter
TGWarwolf 5ef22c7
完成了running letter
TGWarwolf a5bf5c6
完成了1-6项
TGWarwolf 757852e
修改了isprime
TGWarwolf d6a86db
完成了encrypt_decrypt
TGWarwolf 3f2f694
修改了allprime
TGWarwolf f0a8357
修改了部分代码 完成了maze
TGWarwolf 4db9b99
完成了pushbox 第一关
TGWarwolf c10c0fc
完成了pushbox 1~7关
TGWarwolf cd03e26
完成了linkedlist
TGWarwolf 9ea4671
用链表实现质数表(目前还有未修复bug)
TGWarwolf 29d390b
warehouse(未完成版)
TGWarwolf 041410c
完成了warehouse
TGWarwolf 942ad47
修改了部分代码
TGWarwolf 578dda7
完成了Queue
TGWarwolf adaae93
完成了Queue
TGWarwolf a3f1fac
完成了SafeArray(一)(二)
TGWarwolf 5f0c916
完成了cppScoreManagement
TGWarwolf 59bb69d
完成了IntStack(二)
TGWarwolf 9a0eced
完成了CircleAndPoint
TGWarwolf 13481e4
完成了Canvas
TGWarwolf 6089f7f
完成了Circuit 完成了Stack(三)
TGWarwolf fe9c106
完成了Circuit 完成了SafeArray(三)
TGWarwolf 51ba436
完成了Employee&Sales
TGWarwolf 4842c12
打飞机第一次交(加了音乐)
TGWarwolf 334b156
打飞机第一次交(加了音乐)
TGWarwolf 8a5b3c8
打飞机第二次交(可以打子弹)
TGWarwolf dbd7bdd
打飞机第XX次
TGWarwolf 54b4fa9
打飞机第XX次
TGWarwolf 5f52698
打飞机第XX次
TGWarwolf 2cb88d5
打飞机第XX次
TGWarwolf 39c3baf
继续打飞机50分纪念
TGWarwolf 8cade33
继续打飞机60
TGWarwolf 33bbb77
继续打飞机65
TGWarwolf eabf0ce
继续打飞机75
TGWarwolf 1183ad5
继续打飞机83
TGWarwolf 87c6b32
打飞机最后一次103
TGWarwolf 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,37 @@ | ||
| #include<stdio.h> | ||
| #include<windows.h> | ||
| void running(int col); | ||
| int main(void) | ||
| { | ||
| system("mode con cols=63"); | ||
| running(63); | ||
|
|
||
| return 0; | ||
| } | ||
| void running(int col) | ||
| { | ||
| int i,j; | ||
| while(1) | ||
| { | ||
| for(i=0;i<=col-1;i++) | ||
| { | ||
| Sleep(50); | ||
| system("cls"); | ||
| for(j=0;j<i;j++) | ||
| { | ||
| printf(" "); | ||
| } | ||
| putchar('>'); | ||
| } | ||
| for(i=col-1;i>=0;i--) | ||
| { | ||
| Sleep(50); | ||
| system("cls"); | ||
| for(j=0;j<i;j++) | ||
| { | ||
| printf(" "); | ||
| } | ||
| putchar('<'); | ||
| } | ||
| } | ||
| } | ||
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,35 @@ | ||
| #include<stdio.h> | ||
| #include<windows.h> | ||
| #include<stdbool.h> | ||
|
|
||
| void running(int col); | ||
|
|
||
| int main(void){ | ||
| system("mode con cols=63"); | ||
| running(63); | ||
|
|
||
| return 0; | ||
| } | ||
| void running(int col){ | ||
| int i=0,j; | ||
| bool flag=0; | ||
|
|
||
| while(1){ | ||
| Sleep(50); | ||
| system("cls"); | ||
| for(j=0;j<i;j++){ | ||
| printf(" "); | ||
| } | ||
| if(!flag){ | ||
| i++; | ||
| } | ||
| else{ | ||
| i--; | ||
| } | ||
| if(62==i||0==i){ | ||
| flag=!flag; | ||
| } | ||
| putchar('R'); | ||
|
|
||
| } | ||
| } |
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,35 @@ | ||
| #include<stdio.h> | ||
| #include<math.h> | ||
|
|
||
| int is_prime(int n); | ||
|
|
||
| int main(void) | ||
| { | ||
| int n; | ||
|
|
||
| scanf("%d",&n); | ||
| if(is_prime(n)) | ||
| { | ||
| printf("%d is prime.\n",n); | ||
| } | ||
| else | ||
| { | ||
| printf("%d isn/'t prime.\n"); | ||
| } | ||
|
|
||
| return 0; | ||
|
|
||
| } | ||
| int is_prime(int n) | ||
| { | ||
| int i; | ||
|
|
||
| for(i=2;i<=pow(n,0.5);i++) | ||
| { | ||
| if(n%i==0) | ||
| { | ||
| return 0; | ||
| } | ||
| } | ||
| return 1; | ||
| } |
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,26 @@ | ||
| #include<stdio.h> | ||
| #define rate 1/6.0+1/12.0+1/7.0 | ||
|
|
||
| void Diophantus(void); | ||
|
|
||
| int main(void) | ||
| { | ||
| Diophantus(); | ||
| system("pause"); | ||
|
|
||
| return 0; | ||
| } | ||
| void Diophantus(void) | ||
| { | ||
| int age_father=6; | ||
|
|
||
| while(age_father<=200) | ||
| { | ||
| if(age_father==(int)age_father*(rate+0.5)+9) | ||
| { | ||
| printf("%d\n",age_father-4); | ||
| } | ||
| age_father+=2; | ||
| } | ||
|
|
||
| } |
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,27 @@ | ||
| #include<stdio.h> | ||
|
|
||
| void narcissus(void); | ||
|
|
||
| int main(void) | ||
| { | ||
| narcissus(); | ||
|
|
||
| return 0; | ||
| } | ||
| void narcissus(void) | ||
| { | ||
| int i; | ||
| int a,b,c; | ||
|
|
||
| for(i=100;i<1000;i++) | ||
| { | ||
| a=i/100; | ||
| b=(i-a*100)/10; | ||
| c=i-a*100-b*10; | ||
| if(i==a*a*a+b*b*b+c*c*c) | ||
| { | ||
| printf("%d\t",i); | ||
| } | ||
| } | ||
|
|
||
| } |
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,40 @@ | ||
| #include<stdio.h> | ||
| #include<time.h> | ||
| #include<math.h> | ||
|
|
||
| int is_prime(int n); | ||
| void printprime(void); | ||
|
|
||
| int main(void) | ||
| { | ||
| printprime(); | ||
|
|
||
| return 0; | ||
| } | ||
| void printprime(void) | ||
| { | ||
| int max,i; | ||
| float delta; | ||
|
|
||
| scanf("%d",&max); | ||
| delta=clock(); | ||
| for(i=2;i<=max;i++) | ||
| { | ||
| if(is_prime(i)) | ||
| { | ||
| printf("%d\t",i); | ||
| } | ||
| } | ||
| delta=clock()-delta; | ||
| printf("\nIt takes %.2f ms\n",delta); | ||
| } | ||
| int is_prime(int n) | ||
| { | ||
| int j; | ||
|
|
||
| for(j=2;j<=pow(n,0.5);j++) | ||
| { | ||
| if(n%j==0)return 0; | ||
| } | ||
| return 1; | ||
| } |
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,83 @@ | ||
| #include<stdio.h> | ||
| #include<stdlib.h> | ||
| typedef struct link_list | ||
| { | ||
| long long int num; | ||
| struct link_list * next; | ||
| }LINK; | ||
| LINK * create(long long int n); | ||
| void dele(LINK * head); | ||
| void screen(LINK * head); | ||
| void display(LINK * head); | ||
| int main(void) | ||
| { | ||
| long long int max; | ||
| LINK * _head; | ||
| scanf("%lld",&max); | ||
| _head=create(max); | ||
|
|
||
| //screen(_head); | ||
| display(_head); | ||
|
|
||
| system("pause"); | ||
| return 0; | ||
| } | ||
| LINK * create(long long int n) | ||
| { | ||
| LINK *head,*cp1,*cp2; | ||
| long long int i; | ||
|
|
||
| head=NULL; | ||
| cp1=cp2=(LINK *)malloc(sizeof(LINK *)); | ||
| for(i=2;i<=n;i++) | ||
| { | ||
| if(2==i) | ||
| { | ||
| head=cp1; | ||
| } | ||
| else | ||
| { | ||
| cp1->next=cp2; | ||
| cp1=cp2; | ||
| } | ||
| cp1->num=i; | ||
| cp2=(LINK *)malloc(sizeof(LINK *)); | ||
| } | ||
| cp1->next=NULL; | ||
| free(cp2); | ||
|
|
||
| return head; | ||
| } | ||
| void screen(LINK * head) | ||
| { | ||
| LINK *cp1,*cp2,*cp3,*temp; | ||
| cp1=cp2=cp3=head; | ||
| while(cp3!=NULL) | ||
| { | ||
| cp2=cp3; | ||
| cp1=cp3; | ||
| while(cp2!=NULL&&cp1!=NULL) | ||
| { | ||
| cp2=cp2->next; | ||
| if(cp2!=NULL&&0==cp2->num%cp3->num) | ||
| { | ||
| temp=cp2; | ||
| cp1->next=cp1->next->next; | ||
| cp2=cp2->next; | ||
| } | ||
| cp1=cp1->next; | ||
| } | ||
| cp3=cp3->next; | ||
| } | ||
| } | ||
| void display(LINK * head) | ||
| { | ||
| LINK *cp; | ||
|
|
||
| cp=head; | ||
| while(cp!=NULL) | ||
| { | ||
| printf("%lld\t",cp->num); | ||
| cp=cp->next; | ||
| } | ||
| } |
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,75 @@ | ||
| #include<stdio.h> | ||
| #include<math.h> | ||
|
|
||
| int is_prime(int n); | ||
| int _prime(int *P); | ||
| void Goldbach(int *P,int n); | ||
|
|
||
| int main(void) | ||
| { | ||
| int prime[100]; | ||
| int max; | ||
|
|
||
| max=_prime(prime); | ||
| Goldbach(prime,max); | ||
|
|
||
| return 0; | ||
|
|
||
| } | ||
| void Goldbach(int *P,int n) | ||
| { | ||
| int even=4; | ||
| int i,j; | ||
| int B; | ||
|
|
||
| while(even<=100) | ||
| { | ||
| B=0; | ||
| for(i=0;i<n;i++) | ||
| { | ||
| for(j=i;j<n;j++) | ||
| { | ||
| if(even==P[i]+P[j]) | ||
| { | ||
| printf("%3d=%3d+%3d\n",even,P[i],P[j]); | ||
| even+=2; | ||
| B=1; | ||
| break; | ||
| } | ||
| } | ||
| if(B==1) | ||
| { | ||
| break; | ||
| } | ||
| } | ||
| } | ||
| printf("100���ڵĸ�°ͺղ������!\n"); | ||
| system("pause"); | ||
| } | ||
| int _prime(int *P) | ||
| { | ||
| int i,j=0; | ||
|
|
||
| for(i=2;i<=100;i++) | ||
| { | ||
| if(is_prime(i)) | ||
| { | ||
| P[j]=i; | ||
| j++; | ||
| } | ||
| } | ||
| return j; | ||
| } | ||
| int is_prime(int n) | ||
| { | ||
| int i; | ||
|
|
||
| for(i=2;i<=pow(n,0.5);i++) | ||
| { | ||
| if(n%i==0) | ||
| { | ||
| return 0; | ||
| } | ||
| } | ||
| return 1; | ||
| } |
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.
这个文件需要删掉
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.
好的