C++ 格式化输出到屏幕
各位C++高手.我想请问一下: 我想打印到屏幕.格式是这样的:1 2 3 4 5
6
7
8
9
请问怎么弄啊?
参考答案:cout<<"1 2 3 4 5"<<endl;
cout<<" 6"<<endl;
cout<<" 7"<<endl;
cout<<" 8"<<endl;
cout<<" 9"<<endl;
或:
cout<<"1 2 3 4 5"<<endl;
cout<<setfill" "<<setw(9)"6 "<<endl;
cout<<setw(9)"7 "<<endl;
cout<<setw(9)"8 "<<endl;
cout<<setw(9)"9 "<<endl;