|
@@ -0,0 +1,32 @@
|
|
|
+#include <iostream>
|
|
|
+
|
|
|
+int main3()
|
|
|
+{
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ float f1 = 3.14f;
|
|
|
+ std::cout << "f1 = " << f1 << std::endl;
|
|
|
+
|
|
|
+ double d1 = 3.14;
|
|
|
+ std::cout << "d1 = " << d1 << std::endl;
|
|
|
+
|
|
|
+
|
|
|
+ std::cout << "float占用的内存空间: " << sizeof(float) << std::endl;
|
|
|
+
|
|
|
+ std::cout << "double占用的内存空间: " << sizeof(double) << std::endl;
|
|
|
+
|
|
|
+
|
|
|
+ float f2 = 3e2;
|
|
|
+ std::cout << "f2 = " << f2 << std::endl;
|
|
|
+ float f3 = 3e-2;
|
|
|
+ std::cout << "f3 = " << f3 << std::endl;
|
|
|
+
|
|
|
+
|
|
|
+ system("pause");
|
|
|
+
|
|
|
+ return 0;
|
|
|
+
|
|
|
+}
|