浮点数格式化输出如何消零?浮点数格式化输出如何消零?如 3.12000,输出为3.123.1000,输出为3.13.0000,输出为3[解决办法]
#include <iostream>#include <stdio.h>int _tmain(int argc, _TCHAR* argv[]){ std::cout << 3.12000 << std::endl; printf( "%g\n", 3.1200 ); return 0;}