|
5啊哈币
- #include <stdio.h>
- #include <stdlib.h>
- #include <windows.h>
- int main()
- {
- char a[50][50]={"######",
- "#o # ",
- "# ## #",
- "# # #",
- "## #",
- "######",
- };
- int i,x,y,p,q;
-
- x=1; y=1; p=1; q=5;
- for (i = 0; i <= 5; i++) { /*用for输出迷宫*/
- puts(a[i]);
- /* code */
- }
-
- ch=getch();
- if(ch=='s')
- {
- if(a[x+1][y]!='#')
- {
- a[x][y]=' ';
- x++;
- a[x][y]='o';
- }
- }
-
- system("cls");
- for (int i = 0; i <= 5; i++) {
- puts (a[i]);
- /* code */
- }
-
-
- Sleep(5000);
- return 0;
- }
复制代码 |
|