首页 > 解决方案 > 如何在 C 中打印表格而无需移动垂直线?

问题描述

我必须像这样移动垂直线,因为输出显示未对齐的线。

    printf("DAY 10                           DAILY SUMMARY REPORT                             ");
    printf("\n+---------------------+--------------++-------------+-------------+------------+");
    printf("\n| Today's             | Total        || Total       | Total       | Under      |");
    printf("\n| Cases               | Cases        || Deaths      | Recovered   | treatment  |");
    printf("\n+---------------------+--------------++-------------+-------------+------------+");
    printf("\nLocal :   %d           |              ||             |             |            |",day10localcase);
    printf("\nImported :%d           |              ||             |             |            |", day10importcase);
    printf("\n          %d          |%d           ||%d            |%d           |%d          |", day10case,day10casetotal,day10deathtotal,day10rectotal,day10treattotal);
    printf("\n+------------------------------------++-------------+-------------+------------+");
    printf("\n                                     ||%.1lf%%         |%.1lf%%        |%.1lf%%       |",day10deathtotalpercent,day10rectotalpercent,day10treattotalpercent);
    printf("\n                                     ++----------------------------------------+");
    printf("\n----------------------------End of Day 10 Reporting-----------------------------");
}

标签: c

解决方案


推荐阅读