标签:style blog http color os strong io 2014
precision()
#include<iostream> using namespace std; int main() { float s=11.201 ; cout.precision(2); cout <<s<<endl; return 0; } View Code
#include<iostream>
using namespace std;
int main()
{ float s=11.201 ;
cout.precision(2);
cout <<s<<endl;
return 0;
}
#include<iostream> using namespace std; int main() { ; float t=10001.119; cout.precision(2); cout <<t<<endl; return 0; }
#include<iostream>
using namespace std;
int main()
{
float t=10001.119;
cout.precision(2);
cout <<t<<endl;
return 0;
}
*******************************************************************************************************************************************
#include<iostream> using namespace std; int main() { float s=11.201 ; cout.precision(2); cout.setf(ios::fixed); cout <<s<<endl; return 0; }
#include<iostream> using namespace std; int main() { ; float t=10001.119; cout.precision(2); cout.setf(ios::fixed); cout <<t<<endl; return 0; }
****************************************************************************************************************************************************
#include<iostream> using namespace std; int main() { float s=11.201; cout<<fixed; cout.precision(2); cout <<s<<endl; return 0; }
#include<iostream> using namespace std; int main() { float t=10001.119; cout<<fixed; cout.precision(2); cout <<t<<endl; return 0; }
*****************************************************************************************************************************************************
#include<iostream> #include <iomanip> using namespace std; int main() { float s=11.201; cout<<fixed<<setprecision(2) <<s<<endl; return 0; }
#include<iostream>
#include <iomanip>
using namespace std;
int main()
{
float s=11.201;
cout<<fixed<<setprecision(2) <<s<<endl;
return 0;
}
#include<iostream> #include <iomanip> using namespace std; int main() { float t=10001.119; cout<<fixed<<setprecision(2) <<t<<endl; return 0; }
#include<iostream>
#include <iomanip>
using namespace std;
int main()
{
float t=10001.119;
cout<<fixed<<setprecision(2) <<t<<endl;
return 0;
}
标签:style blog http color os strong io 2014
原文地址:http://www.cnblogs.com/2014acm/p/3887422.html