C语言
printf("姓名 学号 语文 数学 英语 理综 总分 排名\n");怎么将输出的内容与上面语句对齐??? 没学到格式化输出吗?
#include <stdio.h>
int main()
{
printf("%-8s%-8s%-8s%-8s%-8s%-8s%-8s%-8s\n","姓名","学号","语文","数学","英语","理综","总分","排名");
printf("%-8s%-8s%-8s%-8s%-8s%-8s%-8s%-8s\n","李佳宇","5428","0","0","1","3","4","鱼c最低");
}
小剑剑 发表于 2016-7-15 10:07
没学到格式化输出吗?
小甲鱼老师怎么惹你了^_^
李佳宇","5428","0","0","1","3","4","鱼c最低 人造人 发表于 2016-7-15 11:25
小甲鱼老师怎么惹你了^_^
李佳宇","5428","0","0","1","3","4","鱼c最低
开个玩笑嘛{:10_254:} 小剑剑 发表于 2016-7-15 11:40
开个玩笑嘛
^_^ 小剑剑 发表于 2016-7-15 10:07
没学到格式化输出吗?
xiexie
页:
[1]