使用printf输出整数值

#include <stdio.h>

int main(void)
{
  int        i = 15,       j = 345,            k = 4567;
  long long li = 56789LL, lj = 12345678912LL, lk = 12345667LL;

  printf("i = %d   j = %d    k = %d   i = %6.3d   j = %6.3d   k = %6.3d/n", i ,j, k, i, j, k);

  printf("i = %-d   j = %+d   k = %-d   i = %-6.3d   j = %-6.3d   k = %-6.3d/n",i ,j, k, i, j, k);
  printf("li = %d   lj = %d   lk = %d/n", li, lj, lk);
  printf("li = %lld   lj = %lld   lk = %lld/n", li, lj, lk);
  return 0;//
}

原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/266446.html

(0)
上一篇 2022年6月7日
下一篇 2022年6月7日

相关推荐

发表回复

登录后才能评论