C++中的输出方面

来源:百度知道 编辑:UC知道 时间:2024/06/25 10:16:21
cout<<setprecision(4)
<<setw(3)
<<hex
<<100/3.0
<<","
cout<<24<<endl;
上面的24问题中没呀,在这做什么的呀

24就是输出一个常量.
用如下代码可以理解
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
cout<<"ok"<<endl;
cout<<24<<endl;
cout<<setprecision(6)<<setw(3)<<hex<<100/3.0<<"," ;
system("pause");
return 1;
}