//打印普通字符串
printf("Hello,word!\n");
//打印int型
printf("%d\n", 5);
//打印浮点型
printf("%f\n",2.4);
//双精度
printf("%lf\n",2.45);
//保留小数点后两位
printf("%.2f\n", 2.345435);
//保留整数个数,没有默认加空格
printf("%7d\n", 1233232131);
printf("%16d\n", 14324124);
//不够补0而不是空格
printf("%016d\n", 14324124);
//输出字符
printf("%c\n", 'a');
//输出字符串
printf("%s\n", "efwfwfew");
c语言的各种输出
最新推荐文章于 2024-07-24 21:24:38 发布