[C] 在stdout上输出字符 →→→→→进入此内容的聊天室

来自 , 2020-09-25, 写在 C, 查看 166 次.
URL http://www.code666.cn/view/bbaa9d6a
  1. #include <stdio.h>
  2.  
  3. /* define some box-drawing characters */
  4. #define LEFT_TOP  0xDA
  5. #define RIGHT_TOP 0xBF
  6. #define HORIZ     0xC4
  7. #define VERT      0xB3
  8. #define LEFT_BOT  0xC0
  9. #define RIGHT_BOT 0xD9
  10.  
  11. int main(void)
  12. {
  13.    char i, j;
  14.  
  15.    /* draw the top of the box */
  16.    putchar(LEFT_TOP);
  17.    for (i=0; i<10; i++)
  18.       putchar(HORIZ);
  19.    putchar(RIGHT_TOP);
  20.    putchar('\n');
  21.  
  22.    /* draw the middle */
  23.    for (i=0; i<4; i++)
  24.    {
  25.       putchar(VERT);
  26.       for (j=0; j<10; j++)
  27.          putchar(' ');
  28.       putchar(VERT);
  29.       putchar('\n');
  30.    }
  31.  
  32.    /* draw the bottom */
  33.    putchar(LEFT_BOT);
  34.    for (i=0; i<10; i++)
  35.       putchar(HORIZ);
  36.    putchar(RIGHT_BOT);
  37.    putchar('\n');
  38.  
  39.    return 0;
  40. }

回复 "在stdout上输出字符"

这儿你可以回复上面这条便签

captcha