#include <stdio.h>
int main()
{
int i = 1234; long long i2 = 1234; int i3 = -1234;
printf("有符号十进制整型数据i=1234输出:\n");
printf("%%d=%d ", i); //%d有符号十进制整数;
printf("%%hd=%hd ",i); //%hd有符号十进制短整数;
printf("%%ld=%ld ",i); //%ld有符号十进制长整数;
printf("%%lld=%lld ", i2); //%lld有符号十进制超长整数;
printf("\n\n无符号十进制整型数据i=1234输出:\n");
printf("%%u=%u ", i); //%u无符号十进制整数;
printf("%%hu=%hu ", i
0030 printf格式化输出整型数据
最新推荐文章于 2023-11-03 16:56:32 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)