C PRIMER PLUS 学习笔记(一)
2014-06-18 13:22
162 查看
1显示程序执行的窗口一闪即逝。可以添加如下语句:
getchar()
作用是获取键盘输入。
2
float toobig = 3.4e38 * 100.0f;
float not_a_number = asin(1.2);//math.h
printf("%e \t %e\n", toobig,not_a_number);
inf-表示无穷大,nan-Not-a-number
3 long double 的输出格式
long double x;
x = 3.2e-5;
printf("x = %f, x = %e\n", x, x);
printf("x = %lf, x = %le\n", x, x);
printf("x = %Lf, x = %Le\n", x, x);
long double 应采用
%a指十六进制指数格式输出。
getchar()
作用是获取键盘输入。
2
inf和
nan
float toobig = 3.4e38 * 100.0f;
float not_a_number = asin(1.2);//math.h
printf("%e \t %e\n", toobig,not_a_number);
inf-表示无穷大,nan-Not-a-number
3 long double 的输出格式
long double x;
x = 3.2e-5;
printf("x = %f, x = %e\n", x, x);
printf("x = %lf, x = %le\n", x, x);
printf("x = %Lf, x = %Le\n", x, x);
long double 应采用
%Lf(%lf)或者
%Le(%le)或者
%La(%la)
%a指十六进制指数格式输出。
相关文章推荐
- 2012/1/14 《C++ Primer Plus》第六章:分支语句和逻辑操作符 学习笔记
- 2012/1/11 《C++ Primer Plus》第四章:复合类型 学习笔记
- 2012/1/21 《C++ Primer Plus》第八章:函数探幽 学习笔记
- 2012/2/7 《C++ Primer Plus》第十六章:string类和标准模板库 学习笔记
- 2012/1/31 《C++ Primer Plus》第十三章:类继承 学习笔记
- 2012/2/3 《C++ Primer Plus》第十四章:C++中的代码重用 学习笔记
- 2012/1/9 《C++ Primer Plus》第三章:处理数据 学习笔记
- 2012/1/25 《C++ Primer Plus》第十一章:使用类 学习笔记
- 2012/1/21 《C++ Primer Plus》第八章:函数探幽 学习笔记
- 2012/1/22 《C++ Primer Plus》第十章:对象和类 学习笔记
- 2012/1/14 《C++ Primer Plus》第六章:分支语句和逻辑操作符 学习笔记
- 2012/1/19 《C++ Primer Plus》第七章:函数——C++编程模块 学习笔记
- 2012/1/13 《C++ Primer Plus》第五章:循环和表达式 学习笔记
- 2012/1/27 《C++ Primer Plus》第十二章:类和动态内存分配 学习笔记
- 2012/1/8 《C++ Primer Plus》第二章:开始学习C++ 学习笔记
- [学习笔记][C++Primer Plus]String类的使用
- 2012/1/19 《C++ Primer Plus》第七章:函数——C++编程模块 学习笔记
- C++ primer plus 第五版 学习笔记 5章7题
- 2012/2/7 《C++ Primer Plus》第十六章:string类和标准模板库 学习笔记
- 2012/2/3 《C++ Primer Plus》第十四章:C++中的代码重用 学习笔记