求C++代码输出大字

360U2970150330 |浏览1102次
收藏|2022/05/01 19:04

满意回答

2022/05/01 19:23

程序参考如下:#include <stdio.h>void disp(unsigned char (*data)[32], int n){ int i, j, k, t; unsigned char c; for (i = 0; i < 16; i++) { for (j = 0; j < 2 * n; j++) { c = data[j / 2][i * 2 + j % 2]; for (k = 0; k < 8; k++) if (c & (0x80 >> k)) printf("*"); else printf(" "); } printf("\n"); }}int main(){ unsigned char c; unsigned char data[2][32] = { {0x00, 0x08, 0x7f, 0xfc, 0x01, 0x00, 0x01, 0x10, 0x1f, 0xf8, 0x11, 0x10, 0x11, 0x10, 0x1f, 0xf0, 0x11, 0x10, 0x11, 0x14, 0xff, 0xfe, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x50, 0x10, 0x20}, {0x00, 0x10, 0x1f, 0xf8, 0x10, 0x10, 0x11, 0x10, 0x11, 0x10, 0x11, 0x10, 0x11, 0x10, 0x11, 0x10, 0x11, 0x10, 0x12, 0x10, 0x12, 0x90, 0x04, 0x80, 0x04, 0x82, 0x08, 0x82, 0x30, 0x7e, 0xc0, 0x00}}; unsigned char data1[3][32] = { {0x09, 0x00, 0xfd, 0x08, 0x09, 0x08, 0x09, 0x10, 0x09, 0x20, 0x79, 0x40, 0x41, 0x04, 0x47, 0xfe, 0x41, 0x40, 0x79, 0x40, 0x09, 0x20, 0x09, 0x20, 0x09, 0x10, 0x09, 0x4e, 0x51, 0x84, 0x21, 0x00}, {0x40, 0x1c, 0x37, 0xe0, 0x12, 0x48, 0x01, 0x50, 0x80, 0x80, 0x61, 0x10, 0x23, 0xf8, 0x08, 0x40, 0x10, 0x84, 0x27, 0xfc, 0xe0, 0x40, 0x3f, 0xfe, 0x20, 0xa0, 0x21, 0x10, 0x22, 0x0e, 0x2c, 0x04}, {0x10, 0x40, 0x10, 0x40, 0x20, 0x44, 0x27, 0xfe, 0x48, 0x40, 0xfa, 0x48, 0x12, 0x48, 0x22, 0x48, 0x42, 0x48, 0xfb, 0xf8, 0x42, 0x48, 0x00, 0x40, 0x18, 0x42, 0xe0, 0x42, 0x40, 0x3e, 0x00, 0x00}}; disp(data, 2); disp(data1, 3); return 0;}结果

whoami1978

其他回答(1)
  • #include<iostream>using namespace std;int main(){cout<<"再见,张溪纯";return 0;}
    回答于 2022/05/01 19:56
0人关注该问题
+1

 加载中...