#include <iomanip> 추가해주고

oftstream fout;

double a = 1.2039485;

double b = 14.29349;


fout << setprecision(2) << a << " " << b << endl;

fout << setprecision(2) << fixed << a << " " << b << endl;


-----------------------------------------------------------------------------

output:


1.2 14

1.20 14.29

'프로그래밍 > C/C++' 카테고리의 다른 글

Group Sorting  (0) 2012.07.09
이중 if 문에서의 break  (0) 2012.07.05
vector ifstream  (0) 2012.05.28
TCHAR  (0) 2012.05.09
[MFC] 폴더 지정 대화상자로 선택한 폴더 열기  (0) 2012.05.09
Posted by halloRa
,