|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
- /* float_print.c -- 读取一个浮点数,先打印成小数点形式,再打印成指数形式,在打印成p计数法 */
- #include "stdio.h"
- int main(void)
- {
- float f;
- printf("Enter a floating-point value: ");
- scanf("%f", &f);
- printf("fixed-point notation: %f\n", f);
- printf("exponential notation: %e\n", f);
- printf("p notation: %x\n", f);
- //printf("实数%f 的表现形式除了%f, %e, 还有%#x\n", f, f, f);
- return 0;
- }
复制代码
//新手还不能上传图片求助 拜托看看啦
头文件: Windows.h
代码: system("pause");
- /* float_print.c -- 读取一个浮点数,先打印成小数点形式,再打印成指数形式,在打印成p计数法 */
- #include "stdio.h"
- #include <windows.h>
- int main(void)
- {
- float f;
- printf("Enter a floating-point value: ");
- scanf("%f", &f);
- printf("fixed-point notation: %f\n", f);
- printf("exponential notation: %e\n", f);
- printf("p notation: %x\n", f);
- //printf("实数%f 的表现形式除了%f, %e, 还有%#x\n", f, f, f);
- system("pause");
- return 0;
- }
复制代码
|
|