c++程序—浮点数

#include<iostream>
using namespace std;

int main()
{
    //2.单精度float
    //3.双精度double
    //默认情况下会输出6位有效数字
    //科学计数法
    float f1 = 3.14f;
    float f2 = 3e-2;
    
    cout << f1 << endl;
    cout << f2 << endl;
    system("pause");
    return 0;

}

 

posted @ 2020-02-24 11:59  Jackie_Wang  阅读(530)  评论(0编辑  收藏  举报