Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
74ad321
Create running_letter
TGWarwolf Feb 23, 2017
7f4a9ad
Delete running_letter
TGWarwolf Feb 23, 2017
c72b671
Create Running letter
TGWarwolf Feb 23, 2017
1a0cb3a
完成了running letter
TGWarwolf Feb 23, 2017
5ef22c7
完成了running letter
TGWarwolf Feb 23, 2017
a5bf5c6
完成了1-6项
TGWarwolf Feb 23, 2017
757852e
修改了isprime
TGWarwolf Feb 26, 2017
d6a86db
完成了encrypt_decrypt
TGWarwolf Mar 1, 2017
3f2f694
修改了allprime
TGWarwolf Mar 2, 2017
f0a8357
修改了部分代码 完成了maze
TGWarwolf Mar 6, 2017
4db9b99
完成了pushbox 第一关
TGWarwolf Mar 7, 2017
c10c0fc
完成了pushbox 1~7关
TGWarwolf Mar 9, 2017
cd03e26
完成了linkedlist
TGWarwolf Mar 15, 2017
9ea4671
用链表实现质数表(目前还有未修复bug)
TGWarwolf Mar 18, 2017
29d390b
warehouse(未完成版)
TGWarwolf Mar 24, 2017
041410c
完成了warehouse
TGWarwolf Mar 26, 2017
942ad47
修改了部分代码
TGWarwolf Mar 28, 2017
578dda7
完成了Queue
TGWarwolf Mar 28, 2017
adaae93
完成了Queue
TGWarwolf Mar 30, 2017
a3f1fac
完成了SafeArray(一)(二)
TGWarwolf Apr 4, 2017
5f0c916
完成了cppScoreManagement
TGWarwolf Apr 4, 2017
59bb69d
完成了IntStack(二)
TGWarwolf Apr 12, 2017
9a0eced
完成了CircleAndPoint
TGWarwolf Apr 18, 2017
13481e4
完成了Canvas
TGWarwolf Apr 25, 2017
6089f7f
完成了Circuit 完成了Stack(三)
TGWarwolf May 2, 2017
fe9c106
完成了Circuit 完成了SafeArray(三)
TGWarwolf May 4, 2017
51ba436
完成了Employee&Sales
TGWarwolf May 6, 2017
4842c12
打飞机第一次交(加了音乐)
TGWarwolf May 15, 2017
334b156
打飞机第一次交(加了音乐)
TGWarwolf May 15, 2017
8a5b3c8
打飞机第二次交(可以打子弹)
TGWarwolf May 17, 2017
dbd7bdd
打飞机第XX次
TGWarwolf May 22, 2017
54b4fa9
打飞机第XX次
TGWarwolf May 23, 2017
5f52698
打飞机第XX次
TGWarwolf May 23, 2017
2cb88d5
打飞机第XX次
TGWarwolf May 23, 2017
39c3baf
继续打飞机50分纪念
TGWarwolf May 25, 2017
8cade33
继续打飞机60
TGWarwolf May 31, 2017
33bbb77
继续打飞机65
TGWarwolf Jun 1, 2017
eabf0ce
继续打飞机75
TGWarwolf Jun 5, 2017
1183ad5
继续打飞机83
TGWarwolf Jun 6, 2017
87c6b32
打飞机最后一次103
TGWarwolf Jun 14, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions Running letter
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#include<stdio.h>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个文件需要删掉

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的

#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('<');
}
}
}
35 changes: 35 additions & 0 deletions practices/c/level1/p01_runningLetter/runningletter.c
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');

}
}
35 changes: 35 additions & 0 deletions practices/c/level1/p02_isPrime/is_prime.c
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;
}
26 changes: 26 additions & 0 deletions practices/c/level1/p03_Diophantus/Diophantus.c
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;
}

}
27 changes: 27 additions & 0 deletions practices/c/level1/p04_ narcissus/narcissus.c
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);
}
}

}
40 changes: 40 additions & 0 deletions practices/c/level1/p05_allPrimes/allprimes.c
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;
}
83 changes: 83 additions & 0 deletions practices/c/level1/p05_allPrimes/prime.c
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;
}
}
75 changes: 75 additions & 0 deletions practices/c/level1/p06_Goldbach/Goldbach.c
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;
}
Loading