C++ cout 소수점 출력

1 개요[ | ]

C++ cout 소수점 출력
C++
Copy
#include <iostream>
using namespace std;

int main() {
    double x = 10;
    cout << x; // 10
}
Loading
C++
Copy
#include <iostream>
using namespace std;

int main() {
    double x = 10;
    cout << fixed;
	cout.precision(2);
	cout << x; // 10.00
}
Loading

2 같이 보기[ | ]