1 #include <stdio.h>
 2 #define TABINC 8
 3 
 4 main()
 5 {
 6 int c, nb, pos;
 7 nb = 0;
 8 pos = 1;
 9 while((c = getchar())!= EOF)
10 {
11 if(c =='\t')
12 {
13 nb = TABINC - (pos - 1) % TABINC;
14 while (nb > 0)
15 {
16 putchar(' ');
17 ++pos;
18 --nb;
19 }
20 }else if(c == '\n')
21 {
22 putchar(c);
23 pos = 1;
24 }else
25 {
26 putchar(c);
27 ++pos;
28 }
29 }
30 }

 

相关文章:

  • 2022-02-09
  • 2021-12-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-18
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
相关资源
相似解决方案