简单写一个,未必合题意。
#include <stdio.h>
#include <windows.h>
main()
{
unsigned char a[]=
{
0x80,0xc0,0xe0,0xf0,0xf8,0xfc,0xfe,0xff,0x01,0x81,0xc1,0xe1,0xf1,0xf9,0xfd,0xff,
0x03,0x83,0xc3,0xe3,0xf3,0xfb,0xff,0x07,0x87,0xc7,0xe7,0xf7,0xff,0x0f,0x8f,0xcf,
0xef,0xff,0x1f,0x9f,0xdf,0xff,0x3f,0xbf,0xff,0x7f,0xff,0xff,0xfe,0xfd,0xfe,0xf9,
0xfa,0xfc,0xf1,0xf2,0xf4,0xf8,0xe1,0xe2,0xe4,0xe8,0xf0,0xc1,0xc2,0xc4,0xc8,0xd0,
0xe0,0x81,0x82,0x84,0x88,0x90,0xa0,0xc0,0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80,
0x00
};
char c[2]= {' ', '@'};
int i, j, n=sizeof(a);
CONSOLE_CURSOR_INFO cursor_info = {1, 0};
SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &cursor_info);
printf("\n");
while (1)
{
for (i=0; i<n; ++i)
{
for (j=7; j>=0; --j)
printf(" %c", c[(a[i]>>j)&1]);
Sleep(200);
printf("\r");
}
}
cursor_info.bVisible = 1;
SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &cursor_info);
}
[此贴子已经被作者于2017-11-4 06:53编辑过]