小数点后保留两位小数(iomanip)

小数点后保留两位小数(iomanip)

Content #

#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
  float pi = 3.14159265;
  cout << fixed << setprecision(2) << pi << endl;
  return 0;
}

From #