# include<iomanip.h>
void main()
{
double x,y;
cout<<"从键盘上不换行输入6个常数:";
for(int i=0;i<6;i++) {
cin>>x;
y=4*x*x-2*x+5;
cout<<"x="<<setw(5)<<x;
cout<<setw(10)<<"y="<<setw(5)<<y<<endl;
}
}
其中setw是什么意思啊.可以详细解释吗
參考答案:setw()括号中通常给出一个正整数值,用于限定紧跟其后的一个数据项的输出宽度。如:setw(8)表示紧跟其后的数据项的输出占8个字符宽度。
Sets the number of characters to be used as the field width for the next insertion operation.