#include<iostream>
#include<iomanip>
using namespace std;
int main(){
double a = 1.23456789012345;
cout << a << endl;
cout << setprecision(9) << a << endl;
cout << setprecision(6);
cout << setiosflags(ios::fixed);
cout << setiosflags(ios::fixed) << setprecision(6) << a <<endl;
//cout << resetiosflags(ios::fixed);
cout << setiosflags(ios::scientific) << a << endl;
cout << setiosflags(ios::scientific) << setprecision(4) << a << endl;
return 0;
}
浮点数出不来来。后来经过调试发现是
cout << setiosflags(ios::fixed);
cout << setiosflags(ios::fixed) << setprecision(6) << a <