C语言基础:格式化输出带符号的数字
#include <stdio.h>
int main ()
{
int int_value = 5;
printf("Left justifed with sign %-+3d\n",
int_value);
return 1;
}
gcc编译运行输出结果
Left justifed with sign +5
C语言基础:格式化输出带符号的数字
#include <stdio.h>
int main ()
{
int int_value = 5;
printf("Left justifed with sign %-+3d\n",
int_value);
return 1;
}
gcc编译运行输出结果
Left justifed with sign +5