C++编程基础一 07-浮点类型

 1 // 07-浮点类型.cpp: 定义控制台应用程序的入口点。
 2 //
 3 
 4 #include "stdafx.h"
 5 #include <iostream>
 6 #include <climits>
 7 using namespace std;
 8   
 9 
10 int main()
11 {
12     //12.34  89704.45  8.0  0.454213
13     //E表示法
14     float a= +3.4E+9;  //等同于3.4E9  3.4x1000000000=3400000000
15     float b = -3.4E-9;   //-0.0000000034
16 
17     float c = 12.3;
18     float d = 24.5;
19     long double e = 21323.4;
20     cout << c << endl;
21     cout << d << endl;
22 
23     cout << FLT_MAX << endl;
24     cout << FLT_MIN << endl;
25 
26     int t;
27     cin >> t;
28     return 0;
29 }

 

posted on 2018-07-21 14:07  uimodel  阅读(226)  评论(0编辑  收藏  举报

导航