|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
#include <stdio.h>
int main(void)
{
float fl_num;
printf("Enter a floating-point value:");
scanf("%f\n", &fl_num);
printf("fixed-point notation: %f\n", fl_num);
printf("exponential notation: %e\n", fl_num);
printf("p notation: %a\n", fl_num);
return 0;
}
这个是我的代码。
为什么在scanf这一行中%f后面加上换行,需要这样输入才会展示出结果,
Enter a floating-point value:64.25
1
fixed-point notation: 64.250000
exponential notation: 6.425000e+01
p notation: 0x1.01p+6
难道不应该是输入64.25后变成这样吗
Enter a floating-point value:64.25
fixed-point notation: 64.250000
exponential notation: 6.425000e+01
p notation: 0x1.01p+6 |
|