From 16c680711eb122fad2d6c560a9bc0f70e81d7143 Mon Sep 17 00:00:00 2001 From: zhouzijian2000 <79912596+zhouzijian2000@users.noreply.github.com> Date: Tue, 9 Mar 2021 20:28:19 +0800 Subject: [PATCH 01/30] Create p01_runningLetter --- p01_runningLetter | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 p01_runningLetter diff --git a/p01_runningLetter b/p01_runningLetter new file mode 100644 index 00000000..c9484fa2 --- /dev/null +++ b/p01_runningLetter @@ -0,0 +1,20 @@ +#include +using namespace std; +int cnt,v; +int main() +{ + while(1) + { + for(int i=0;i<=120;i++) + { + cout<0;i--) + { + cout< Date: Tue, 9 Mar 2021 20:38:36 +0800 Subject: [PATCH 02/30] Create p02_isPrime --- p02_isPrime | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 p02_isPrime diff --git a/p02_isPrime b/p02_isPrime new file mode 100644 index 00000000..116b1eea --- /dev/null +++ b/p02_isPrime @@ -0,0 +1,18 @@ +#include +using namespace std; +int n; +int main() +{ + cin>>n; + int m=(int)sqrt(n)+1; + for(int i=2;i Date: Tue, 9 Mar 2021 21:20:44 +0800 Subject: [PATCH 03/30] Create p03_Diophantus --- p03_Diophantus | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 p03_Diophantus diff --git a/p03_Diophantus b/p03_Diophantus new file mode 100644 index 00000000..212d1754 --- /dev/null +++ b/p03_Diophantus @@ -0,0 +1,14 @@ +#include +using namespace std; +int main() +{ + for(float i=1;;i++) + { + if(i/6+i/12+i/7+5+4==i/2) + { + cout< Date: Tue, 9 Mar 2021 21:21:37 +0800 Subject: [PATCH 04/30] Create p04_ narcissus --- p04_ narcissus | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 p04_ narcissus diff --git a/p04_ narcissus b/p04_ narcissus new file mode 100644 index 00000000..70d914fe --- /dev/null +++ b/p04_ narcissus @@ -0,0 +1,26 @@ +#include +using namespace std; +int cub(int x) +{ + return x*x*x; +} +bool nar(int x) +{ + int sum=0; + int sum0=x; + while(x>0) + { + sum+=cub(x%10); + x/=10; + } + return sum==sum0; +} +int main() +{ + for(int i=100;i<=999;i++) + { + if(nar(i)) cout< Date: Tue, 9 Mar 2021 21:32:50 +0800 Subject: [PATCH 05/30] Create p05_allPrimes --- p05_allPrimes | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 p05_allPrimes diff --git a/p05_allPrimes b/p05_allPrimes new file mode 100644 index 00000000..a7aecfd5 --- /dev/null +++ b/p05_allPrimes @@ -0,0 +1,25 @@ +#include +#include +using namespace std; +int main() +{ + int isprime[1000]; + for(int i=0;i<=1000;i++) + { + isprime[i]=1; + } + for(int i=2;i<=1000;i++) + { + if(isprime[i]==1) + { + cout< Date: Tue, 9 Mar 2021 21:33:34 +0800 Subject: [PATCH 06/30] Create p06_Goldbach --- p06_Goldbach | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 p06_Goldbach diff --git a/p06_Goldbach b/p06_Goldbach new file mode 100644 index 00000000..88762aa6 --- /dev/null +++ b/p06_Goldbach @@ -0,0 +1,28 @@ +#include +using namespace std; +int n,p[25]={2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97},r[3]; +void dfs(int x,int s) +{ + if(s>3) return; + else if(x==n && s==3 && r[0]<=r[1] && r[1]<=r[2]) + { + cout<>n; + dfs(0,0); + return 0; +} From be41fbb00600b29cfa25eaa9d451971040d8354a Mon Sep 17 00:00:00 2001 From: zhouzijian2000 <79912596+zhouzijian2000@users.noreply.github.com> Date: Tue, 9 Mar 2021 21:40:14 +0800 Subject: [PATCH 07/30] Update p06_Goldbach --- p06_Goldbach | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/p06_Goldbach b/p06_Goldbach index 88762aa6..586a8fcc 100644 --- a/p06_Goldbach +++ b/p06_Goldbach @@ -23,6 +23,7 @@ void dfs(int x,int s) int main() { cin>>n; - dfs(0,0); + if(n<=5 || n>100) cout<<"error"< Date: Thu, 11 Mar 2021 00:04:47 +0800 Subject: [PATCH 08/30] =?UTF-8?q?Create=20=E6=B1=89=E8=AF=BA=E5=A1=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\261\211\350\257\272\345\241\224" | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 "\346\261\211\350\257\272\345\241\224" diff --git "a/\346\261\211\350\257\272\345\241\224" "b/\346\261\211\350\257\272\345\241\224" new file mode 100644 index 00000000..2b6b7708 --- /dev/null +++ "b/\346\261\211\350\257\272\345\241\224" @@ -0,0 +1,17 @@ +#include +using namespace std; +void hano(int n,char a,char b,char c)//n是准备移动的块数,a是起始柱,b是中间柱,c是目标柱; +{ + if(n==0) return; + printf("将第%d号盘子从%c柱移动到%c柱\n",n,a,c); + hano(n-1,a,c,b);//将n-1个柱子从a移到b; + hano(n-1,b,c,a);//再将n-1个柱子从b移到c,完成任务; +} +int main() +{ + cout<<"盘子越大,盘子的号码越小!!!"<>n; + hano(n,'A','B','C'); + return 0; +} From 673421958fbc1a4ab9161bf57a0a1bcea32f72f8 Mon Sep 17 00:00:00 2001 From: zhouzijian2000 <79912596+zhouzijian2000@users.noreply.github.com> Date: Thu, 11 Mar 2021 00:19:43 +0800 Subject: [PATCH 09/30] =?UTF-8?q?Update=20and=20rename=20=E6=B1=89?= =?UTF-8?q?=E8=AF=BA=E5=A1=94=20to=20p08=5Fhanoi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\261\211\350\257\272\345\241\224" => p08_hanoi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename "\346\261\211\350\257\272\345\241\224" => p08_hanoi (60%) diff --git "a/\346\261\211\350\257\272\345\241\224" b/p08_hanoi similarity index 60% rename from "\346\261\211\350\257\272\345\241\224" rename to p08_hanoi index 2b6b7708..52ede50c 100644 --- "a/\346\261\211\350\257\272\345\241\224" +++ b/p08_hanoi @@ -3,13 +3,13 @@ using namespace std; void hano(int n,char a,char b,char c)//n是准备移动的块数,a是起始柱,b是中间柱,c是目标柱; { if(n==0) return; + hano(n-1,a,c,b);//先将第n个盘子上的n-1个盘子从a移到b; printf("将第%d号盘子从%c柱移动到%c柱\n",n,a,c); - hano(n-1,a,c,b);//将n-1个柱子从a移到b; - hano(n-1,b,c,a);//再将n-1个柱子从b移到c,完成任务; + hano(n-1,b,c,a);//再将n-1个盘子从b移到c,完成任务; } int main() { - cout<<"盘子越大,盘子的号码越小!!!"<>n; hano(n,'A','B','C'); From 89105f1869470c581f16d474fcaf6603c42a2909 Mon Sep 17 00:00:00 2001 From: zhouzijian2000 <79912596+zhouzijian2000@users.noreply.github.com> Date: Sat, 13 Mar 2021 13:59:53 +0800 Subject: [PATCH 10/30] Create p09_maze --- p09_maze | 110 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 p09_maze diff --git a/p09_maze b/p09_maze new file mode 100644 index 00000000..d1b590e7 --- /dev/null +++ b/p09_maze @@ -0,0 +1,110 @@ +#include +#include +using namespace std; +int xx[]={1,-1,0,0},yy[]={0,0,1,-1},v[44][44],mp[44][44]; +struct Node +{ + int nx,ny; +}nod; +void dfs(int x,int y) +{ + mp[x][y]=1; + if(x==1 && y==1) return; + int s=rand()%4; + for(int i=s;i0 && dy>0 && dx<43 && dy<43 && v[dx][dy]==0) + { + int flag=0; + for(int k=0;k<4;k++) + { + int ddx=dx+xx[k]; + int ddy=dy+yy[k]; + if(mp[ddx][ddy]==1) flag++; + } + if(flag==1)//保证不和别的路挖穿,增加迷宫难度; + { + v[dx][dy]=1; + dfs(dx,dy); + } + } + else v[dx][dy]=1; + } +} +int main() +{ + for(int i=0;i<44;i++) + { + for(int j=0;j<44;j++) mp[i][j]=0; + } + dfs(42,42); + mp[1][0]=2; + mp[42][43]=1; + for(int i=0;i<44;i++) + { + for(int j=0;j<44;j++) + { + if(mp[i][j]==1) cout<<" "; + else if(mp[i][j]==0) cout<<"口"; + else if(mp[i][j]==2) cout<<"睿"; + } + cout< Date: Tue, 16 Mar 2021 18:18:46 +0800 Subject: [PATCH 11/30] Update p01_runningLetter --- p01_runningLetter | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/p01_runningLetter b/p01_runningLetter index c9484fa2..fa26bb92 100644 --- a/p01_runningLetter +++ b/p01_runningLetter @@ -1,20 +1,17 @@ #include using namespace std; -int cnt,v; +int cnt; +bool flag; int main() { while(1) { - for(int i=0;i<=120;i++) - { - cout<0;i--) - { - cout< Date: Tue, 16 Mar 2021 19:38:04 +0800 Subject: [PATCH 12/30] Create p07_encrypt_decrypt --- p07_encrypt_decrypt | 69 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 p07_encrypt_decrypt diff --git a/p07_encrypt_decrypt b/p07_encrypt_decrypt new file mode 100644 index 00000000..bab7aa9b --- /dev/null +++ b/p07_encrypt_decrypt @@ -0,0 +1,69 @@ +//本加密器目前仅支持对26个小写英文字母加密 +#include +#include +#include +using namespace std; +string w,mp="qazxswedcvfrtgbnhyujmkiolp"; +void enc(void) +{ + for(int i=0;i>w; + for(int i=0;i122) + { + cout< Date: Tue, 23 Mar 2021 21:05:46 +0800 Subject: [PATCH 13/30] Create p11_linkedList --- p11_linkedList | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 p11_linkedList diff --git a/p11_linkedList b/p11_linkedList new file mode 100644 index 00000000..0cfdf787 --- /dev/null +++ b/p11_linkedList @@ -0,0 +1,70 @@ +#include +using namespace std; +struct linkedlist +{ + linkedlist*next; + int key; +}; +void insert(linkedlist*h,linkedlist*p) +{ + linkedlist*t=h; + while(1) + { + if(t->next==NULL) + { + t->next=p; + break; + } + t=t->next; + } +} +void _delete(linkedlist*h) +{ + h=h->next; +} +void search(linkedlist*h,int k) +{ + linkedlist*t=h; + for(int i=0;t!=NULL;i++) + { + if(t->key==k) cout<next; + } + cout<<-1<>n>>key; + head=(linkedlist*)malloc(n*sizeof(linkedlist)); + *head=(linkedlist){NULL,key}; + for(int i=1;i>key; + head[i]=(linkedlist){NULL,key}; + insert(head,head+i); + } + linkedlist*t=head; + for(int i=0;ikey<<" "; + t=t->next; + } + cout<next=NULL; + for(int i=1;ikey<<" "; + t=t->next; + } + cout< Date: Tue, 23 Mar 2021 21:34:45 +0800 Subject: [PATCH 14/30] Update p11_linkedList --- p11_linkedList | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/p11_linkedList b/p11_linkedList index 0cfdf787..2e42b773 100644 --- a/p11_linkedList +++ b/p11_linkedList @@ -38,6 +38,11 @@ int main() int key,n; cin>>n>>key; head=(linkedlist*)malloc(n*sizeof(linkedlist)); + if(head==NULL) + { + cout<<"申请内存失败!" + return 0; + } *head=(linkedlist){NULL,key}; for(int i=1;i Date: Tue, 30 Mar 2021 19:37:05 +0800 Subject: [PATCH 15/30] Rename p01_runningLetter to p01_runningLetter.cpp --- p01_runningLetter => p01_runningLetter.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename p01_runningLetter => p01_runningLetter.cpp (100%) diff --git a/p01_runningLetter b/p01_runningLetter.cpp similarity index 100% rename from p01_runningLetter rename to p01_runningLetter.cpp From 09ca3871897cd8043118c23d22120fb233c9c8b7 Mon Sep 17 00:00:00 2001 From: zhouzijian2000 <79912596+zhouzijian2000@users.noreply.github.com> Date: Tue, 30 Mar 2021 19:39:33 +0800 Subject: [PATCH 16/30] Rename p02_isPrime to p02_isPrime.cpp --- p02_isPrime => p02_isPrime.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename p02_isPrime => p02_isPrime.cpp (100%) diff --git a/p02_isPrime b/p02_isPrime.cpp similarity index 100% rename from p02_isPrime rename to p02_isPrime.cpp From b7e149915b18b3ef8f5a234ec9ba89fda1e85b38 Mon Sep 17 00:00:00 2001 From: zhouzijian2000 <79912596+zhouzijian2000@users.noreply.github.com> Date: Tue, 30 Mar 2021 19:39:52 +0800 Subject: [PATCH 17/30] Rename p03_Diophantus to p03_Diophantus.cpp --- p03_Diophantus => p03_Diophantus.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename p03_Diophantus => p03_Diophantus.cpp (100%) diff --git a/p03_Diophantus b/p03_Diophantus.cpp similarity index 100% rename from p03_Diophantus rename to p03_Diophantus.cpp From c89c43212a3cb1aca7b603282abda4b998c2c2dd Mon Sep 17 00:00:00 2001 From: zhouzijian2000 <79912596+zhouzijian2000@users.noreply.github.com> Date: Tue, 30 Mar 2021 19:40:17 +0800 Subject: [PATCH 18/30] Rename p04_ narcissus to p04_narcissus.cpp --- p04_ narcissus => p04_narcissus.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename p04_ narcissus => p04_narcissus.cpp (100%) diff --git a/p04_ narcissus b/p04_narcissus.cpp similarity index 100% rename from p04_ narcissus rename to p04_narcissus.cpp From 1dcb458ada364870ff63fbec8cd56ed206a7a301 Mon Sep 17 00:00:00 2001 From: zhouzijian2000 <79912596+zhouzijian2000@users.noreply.github.com> Date: Tue, 30 Mar 2021 19:40:36 +0800 Subject: [PATCH 19/30] Rename p05_allPrimes to p05_allPrimes.cpp --- p05_allPrimes => p05_allPrimes.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename p05_allPrimes => p05_allPrimes.cpp (100%) diff --git a/p05_allPrimes b/p05_allPrimes.cpp similarity index 100% rename from p05_allPrimes rename to p05_allPrimes.cpp From 2b97a42e5254312f64dd13b7fcb4e51d4b8bbcfc Mon Sep 17 00:00:00 2001 From: zhouzijian2000 <79912596+zhouzijian2000@users.noreply.github.com> Date: Tue, 30 Mar 2021 19:42:38 +0800 Subject: [PATCH 20/30] Rename p06_Goldbach to p06_Goldbach.cpp --- p06_Goldbach => p06_Goldbach.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename p06_Goldbach => p06_Goldbach.cpp (100%) diff --git a/p06_Goldbach b/p06_Goldbach.cpp similarity index 100% rename from p06_Goldbach rename to p06_Goldbach.cpp From d5de3eb82c4a6eecaac572e032c3a75754386abe Mon Sep 17 00:00:00 2001 From: zhouzijian2000 <79912596+zhouzijian2000@users.noreply.github.com> Date: Tue, 30 Mar 2021 19:44:36 +0800 Subject: [PATCH 21/30] Rename p07_encrypt_decrypt to p07_encrypt_decrypt.cpp --- p07_encrypt_decrypt => p07_encrypt_decrypt.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename p07_encrypt_decrypt => p07_encrypt_decrypt.cpp (100%) diff --git a/p07_encrypt_decrypt b/p07_encrypt_decrypt.cpp similarity index 100% rename from p07_encrypt_decrypt rename to p07_encrypt_decrypt.cpp From 60073041b83d74071f144f55e9b5564e6bc88585 Mon Sep 17 00:00:00 2001 From: zhouzijian2000 <79912596+zhouzijian2000@users.noreply.github.com> Date: Tue, 30 Mar 2021 19:52:40 +0800 Subject: [PATCH 22/30] Rename p08_hanoi to p08_hanoi.cpp --- p08_hanoi => p08_hanoi.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename p08_hanoi => p08_hanoi.cpp (100%) diff --git a/p08_hanoi b/p08_hanoi.cpp similarity index 100% rename from p08_hanoi rename to p08_hanoi.cpp From 78b9e44eeaf920fca0d58d8648a0311efa6432bc Mon Sep 17 00:00:00 2001 From: zhouzijian2000 <79912596+zhouzijian2000@users.noreply.github.com> Date: Tue, 30 Mar 2021 19:53:47 +0800 Subject: [PATCH 23/30] Update and rename p09_maze to p09_maze.cpp --- p09_maze => p09_maze.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) rename p09_maze => p09_maze.cpp (89%) diff --git a/p09_maze b/p09_maze.cpp similarity index 89% rename from p09_maze rename to p09_maze.cpp index d1b590e7..6bace5c6 100644 --- a/p09_maze +++ b/p09_maze.cpp @@ -48,7 +48,7 @@ int main() { if(mp[i][j]==1) cout<<" "; else if(mp[i][j]==0) cout<<"口"; - else if(mp[i][j]==2) cout<<"睿"; + else if(mp[i][j]==2) cout<<"人"; } cout< Date: Tue, 30 Mar 2021 19:54:11 +0800 Subject: [PATCH 24/30] Rename p11_linkedList to p11_linkedList.cpp --- p11_linkedList => p11_linkedList.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename p11_linkedList => p11_linkedList.cpp (100%) diff --git a/p11_linkedList b/p11_linkedList.cpp similarity index 100% rename from p11_linkedList rename to p11_linkedList.cpp From 89343a51419911043aac5f4bea4e46046109eac8 Mon Sep 17 00:00:00 2001 From: zhouzijian2000 <79912596+zhouzijian2000@users.noreply.github.com> Date: Tue, 30 Mar 2021 23:48:37 +0800 Subject: [PATCH 25/30] Update p11_linkedList.cpp --- p11_linkedList.cpp | 163 +++++++++++++++++++++++++++++++++------------ 1 file changed, 122 insertions(+), 41 deletions(-) diff --git a/p11_linkedList.cpp b/p11_linkedList.cpp index 2e42b773..08525df2 100644 --- a/p11_linkedList.cpp +++ b/p11_linkedList.cpp @@ -1,75 +1,156 @@ #include using namespace std; -struct linkedlist +struct Node { - linkedlist*next; int key; + Node*next; }; -void insert(linkedlist*h,linkedlist*p) +void append(Node*head,Node*newnode) { - linkedlist*t=h; + Node*p; + p=head; while(1) { - if(t->next==NULL) + if(p->next==NULL) { - t->next=p; + p->next=newnode; break; - } - t=t->next; + } + p=p->next; } } -void _delete(linkedlist*h) +void _delete(int n,Node*head) { - h=h->next; + Node*p,*q; + p=q=head;//不要忘记初始化; + for(int i=1;inext; + if(inext; + } + q->next=p->next; + free(p); } -void search(linkedlist*h,int k) +void insert(int n,Node*head,Node*newone)//指插入在第n位的后面 ; { - linkedlist*t=h; - for(int i=0;t!=NULL;i++) + Node*p=head; + for(int i=1;ikey==k) cout<next; + p=p->next; } - cout<<-1<next=p->next; + p->next=newone; } +Node*reverse(Node*head) +{ + Node*n,*p,*q; + n=head; + p=head->next; + if(p==NULL) return head; + q=p->next; + while(p!=NULL) + { + p->next=n; + n=p; + p=q; + if(q!=NULL) q=q->next; //不能让q“越界”; + } + head->next=NULL; + return n; +} int main() { - linkedlist*head; - int key,n; - cin>>n>>key; - head=(linkedlist*)malloc(n*sizeof(linkedlist)); + Node*head; + head=(Node*)malloc(sizeof(Node)); if(head==NULL) { - cout<<"申请内存失败!" + cout<<"error"<>v; + *head=(Node){v,NULL}; + while(1) { - cin>>key; - head[i]=(linkedlist){NULL,key}; - insert(head,head+i); + cin>>v; + if(v==-1) break; + Node*p; + p=(Node*)malloc(sizeof(Node)); + if(p==NULL) + { + cout<<"error"<key<<" "; - t=t->next; + cout<key<<" "; + p=p->next; } cout<next=NULL; - for(int i=1;ikey<<" "; + p=p->next; } - t=head+n-1; - for(int i=0;ikey<<" "; - t=t->next; + if(p->key==5) + { + cout<next; + } + if(flag==0) cout<<-1<key<next; + } */ + +/*用于测试insert函数 + Node*t; + int m; + t=(Node*)malloc(sizeof(Node));//不要忘了用malloc给t分配内存! + cin>>m>>v; + *t=(Node){v,NULL}; + insert(m,head,t); + p=head; + while(p!=NULL) + { + cout<key<next; + } */ + +//接下来是释放所有用malloc请求的内存 + p=head; + while(p!=NULL) + { + Node*q=p->next; + free(p); + p=q; } - cout< Date: Mon, 5 Apr 2021 21:10:35 +0800 Subject: [PATCH 26/30] Create p12_warehouse.cpp --- p12_warehouse.cpp | 135 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 p12_warehouse.cpp diff --git a/p12_warehouse.cpp b/p12_warehouse.cpp new file mode 100644 index 00000000..64cae562 --- /dev/null +++ b/p12_warehouse.cpp @@ -0,0 +1,135 @@ +#include +#include +#include +using namespace std; +int n; +struct stuff +{ + char name[21]; + int num; +}a[10001]; +void dispaly() +{ + printf("现在库房内共有%d种货物\n",n); + for(int i=0;i Date: Mon, 5 Apr 2021 21:11:46 +0800 Subject: [PATCH 27/30] Update p09_maze.cpp --- p09_maze.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/p09_maze.cpp b/p09_maze.cpp index 6bace5c6..4888baaa 100644 --- a/p09_maze.cpp +++ b/p09_maze.cpp @@ -1,3 +1,4 @@ +//此程序的地图是用深度优先搜素算法(dfs)随机生成的! #include #include using namespace std; From 0243059091e386ded0cf5a06f4b08a09d8015ea4 Mon Sep 17 00:00:00 2001 From: zhouzijian2000 <79912596+zhouzijian2000@users.noreply.github.com> Date: Mon, 5 Apr 2021 21:27:56 +0800 Subject: [PATCH 28/30] Add files via upload --- List.txt | 4 + p12_warehouse.cpp | 270 +++++++++++++++++++++++----------------------- 2 files changed, 139 insertions(+), 135 deletions(-) create mode 100644 List.txt diff --git a/List.txt b/List.txt new file mode 100644 index 00000000..947c19da --- /dev/null +++ b/List.txt @@ -0,0 +1,4 @@ +3 +a 1444 +b 600 +c 99 diff --git a/p12_warehouse.cpp b/p12_warehouse.cpp index 64cae562..75a10b8b 100644 --- a/p12_warehouse.cpp +++ b/p12_warehouse.cpp @@ -1,135 +1,135 @@ -#include -#include -#include -using namespace std; -int n; -struct stuff -{ - char name[21]; - int num; -}a[10001]; -void dispaly() -{ - printf("现在库房内共有%d种货物\n",n); - for(int i=0;i +#include +#include +using namespace std; +int n; +struct stuff +{ + char name[21]; + int num; +}a[10001]; +void dispaly() +{ + printf("ڿⷿڹ%dֻ\n",n); + for(int i=0;i Date: Mon, 5 Apr 2021 23:26:37 +0800 Subject: [PATCH 29/30] Add files via upload MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 目前只完成了一张地图 --- 0.txt | 11 ++++ p10_pushboxs.cpp | 142 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 153 insertions(+) create mode 100644 0.txt create mode 100644 p10_pushboxs.cpp diff --git a/0.txt b/0.txt new file mode 100644 index 00000000..baec051b --- /dev/null +++ b/0.txt @@ -0,0 +1,11 @@ +9 9 +0 0 0 0 0 0 0 0 0 +3 1 1 1 1 1 1 1 0 +0 1 1 1 1 1 1 1 0 +0 1 1 1 2 1 1 1 0 +0 1 1 1 1 1 1 1 0 +0 1 1 1 1 1 1 1 0 +0 1 1 1 1 1 1 1 0 +0 1 1 1 1 1 1 1 1 +0 0 0 0 0 0 0 0 0 + diff --git a/p10_pushboxs.cpp b/p10_pushboxs.cpp new file mode 100644 index 00000000..03e58ac0 --- /dev/null +++ b/p10_pushboxs.cpp @@ -0,0 +1,142 @@ +#include +#include +#include +using namespace std; +char c; +int n,m,mp[50][50],cnt,xx[]={1,-1,0,0},yy[]={0,0,1,-1}; +struct Node +{ + int nx,ny; +}nod; +int main() +{ + while(1) + { + cout<<"ӭСϷ"<='0' && c<='9') + { + system("cls"); + break; + } + else cout<<"error"<=0 && dy>=0 && dx Date: Mon, 5 Apr 2021 23:32:37 +0800 Subject: [PATCH 30/30] Update p10_pushboxs.cpp --- p10_pushboxs.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/p10_pushboxs.cpp b/p10_pushboxs.cpp index 03e58ac0..49d6540f 100644 --- a/p10_pushboxs.cpp +++ b/p10_pushboxs.cpp @@ -12,8 +12,8 @@ int main() { while(1) { - cout<<"ӭСϷ"<='0' && c<='9') { system("cls"); @@ -29,7 +29,7 @@ int main() fp=fopen(s,"r"); if(fp==NULL) { - cout<<"ͼȡʧܣ"<