printf()中的左对齐和右对齐

#include<stdio.h>
int main()
{
	return 0;
	printf("%d%d\n",11111,22222);//默认左对齐,宽度是数据本身
	printf("%-10d%d\n",11111,22222);//左对齐,宽度是10
	printf("%10d%d",11111,22222);//右对齐,宽度是10
}
/*
1111122222
11111     22222
     1111122222
*/
发布了117 篇原创文章 · 获赞 71 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/qq_34686440/article/details/105317751
今日推荐