c - 如何在 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-----------------------------");
}
解决方案
推荐阅读
- r - 使用R在字符串中最后一个反斜杠后提取8个字符
- django - Django SetPasswordForm 不呈现任何东西
- python - 如何使用 python 的键盘模块阻止特定的键盘键?
- bash - 复制整个目录,但排除具有特定名称的所有文件夹和子文件夹
- snowflake-cloud-data-platform - 使用变量在雪花中创建任务
- ios - 如何从遥控器克隆未配对的 BLE 信号以触发设备?
- sql - PostgreSQL 中的连接表
- visual-studio-code - VS Code 强加不需要的 XML 格式(例如,在结束标记中添加空格)
- python - 如何使用正则表达式和python在字符串中查找特定文本
- haskell - 如何在 WSL 上运行堆栈 ghci?