标签:inf http double info 数字 image 精准 bsp world
#include <stdio.h>
int main() {
int x=1234;
double f=123.456;
double m=123.456;
char ch=‘a‘;
char a[]="Hello, world!";
int y=3, z=4;
printf("%d %d\n", y, z);
printf("y=%d, z=%d\n", y,z);
printf("%8d,%2d\n", x,x);
printf("%f, %8f, %8.1f, %0.2f, %.2e\n",f,f,f,f,f); //小数点后位数限制要四舍五入,对于浮点型并不能做到每个数字都精准表达,只能取最接近的数
printf("%lf\n",m);
printf("%3c\n", ch);
printf("%s\n%15s\n%10.5s\n%2.5s\n%.3s\n",a,a,a,a,a);
return 0;
}
标签:inf http double info 数字 image 精准 bsp world
原文地址:https://www.cnblogs.com/love-elaine/p/11768803.html