特辣小菜
- #include <stdio.h>
- #include <windows.h>
- //***** *
- //* ** **** * ****
- //***** * **** *
- //* ** * * * *
- //* ** ** * * * ****
- //
- #define N 5
- void GoToXY(int x,int y)
- {
- COORD pos = {x,y};
- HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
- SetConsoleCursorPosition(hOut, pos);
- }
- char f[5][5] = {'*','*','*','*','*',
- '*',' ',' ',' ',' ',
- '*','*','*','*','*',
- '*',' ',' ',' ',' ',
- '*',' ',' ',' ',' ' };
- char i[5][5] = {' ',' ',' ',' ',' ',
- '*','*',' ',' ',' ',
- ' ',' ',' ',' ',' ',
- '*','*',' ',' ',' ',
- '*','*',' ',' ',' ' };
- char s[5][5] = {' ',' ',' ',' ',' ',
- ' ','*','*','*','*',
- ' ','*',' ',' ',' ',
- ' ',' ',' ','*',' ',
- '*','*',' ','*',' ' };
- char h[5][5] = {'*',' ',' ',' ',' ',
- '*',' ',' ',' ',' ',
- '*','*','*','*',' ',
- '*',' ',' ',' ','*',
- '*',' ',' ',' ','*' };
-
- char c[5][5] = {' ',' ',' ',' ',' ',
- ' ','*','*','*','*',
- '*',' ',' ',' ',' ',
- '*',' ',' ',' ',' ',
- ' ','*','*','*','*' };
- void printChar(char a[N][N],int n)
- {
- int i,j;
- for ( i=0;i < N ;i++)
- {
- for ( j=0;j < N ;j++)
- {
- GoToXY(n*10 + j, i);
- printf("%c",a[i][j]);
- Sleep(80);
- }
- }
-
- }
- void main()
- {
-
- while(1){
-
- printChar(f,0);
- printChar(i,1);
- printChar(s,2);
- printChar(h,3);
- printChar(c,4);
- system("cls");
- }
-
-
- }
复制代码 |