flat a = 1;
flat b = 3;
cout << a <endl;
cout << showpoint << b <endl;
ANSI C++里一个浮点型若是小数部分为0,直接输出必然是不带小数点的,例如float b=3;你若想输出3.0,输出代码要这样写:cout << showpoint << a;
标签:输出,cout,flat,浮点数,float,c++ From: https://blog.51cto.com/u_16248677/7386444
flat a = 1;
flat b = 3;
cout << a <endl;
cout << showpoint << b <endl;
ANSI C++里一个浮点型若是小数部分为0,直接输出必然是不带小数点的,例如float b=3;你若想输出3.0,输出代码要这样写:cout << showpoint << a;
标签:输出,cout,flat,浮点数,float,c++ From: https://blog.51cto.com/u_16248677/7386444