📄 2_1.cpp
字号:
#include <iostream.h>
#include <iomanip.h>
int main()
{
cout<<setw(10)<<setiosflags(ios::left)<<"DATA1"
<<setw(10)<<setiosflags(ios::left)<<"DATA2"
<<setw(10)<<setiosflags(ios::left)<<"DATA3"<<endl;
cout<<setw(10)<<setiosflags(ios::fixed)<<setprecision(2)<<102.34
<<setw(10)<<setiosflags(ios::fixed)<<setprecision(2)<<100.23
<<setw(10)<<setiosflags(ios::fixed)<<setprecision(2)<<10.20<<endl;
cout<<setw(10)<<setiosflags(ios::fixed)<<setprecision(2)<<10.0
<<setw(10)<<setiosflags(ios::fixed)<<setprecision(2)<<9.8
<<setw(10)<<setiosflags(ios::fixed)<<setprecision(2)<<1.34<<endl;
cout<<setw(10)<<setiosflags(ios::fixed)<<setprecision(2)<<1000.56
<<setw(10)<<setiosflags(ios::fixed)<<setprecision(2)<<1234.30
<<setw(10)<<setiosflags(ios::fixed)<<setprecision(2)<<145.39<<endl;
return(0);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -