#include <iostream> #include <iomanip> #include <string> using namespace std; int main( ) { ios_base::fmtflags flags = cout.flags( ); double pi = 3.14285714; cout << "pi = " << scientific << noshowpos << pi << '\n'; cout.flags(flags); }
pi = 3.142857e+000