You can use <iomanip.h> =>
所在版块:求学狮城 发贴时间:2003-03-12 21:21

用户信息
复制本帖HTML代码
高亮: 今天贴 X 昨天贴 X 前天贴 X 
For formatted input/output, the file <iomanip.h> is very useful,

and we can say it is the key factor.


cout << setiosflags(ios::left); //to left-adjustify the output.


cout << setw(8) << "Hello" << endl;


The problem is solved. :) easy?


Do make yourself familiar with <iomanip.h>


Wish you a good day!
.
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!

Put your OWN COOL signature here!
 相关帖子 我要回复↙ ↗回到正文
请问:关于c++左端对齐... notice   (104 bytes , 420reads )
再问:关于c++的问题 notice   (91 bytes , 211reads )
You can try this => 魅力十足   (489 bytes , 334reads )
Ha ha ha.... A simple version => 魅力十足   (194 bytes , 275reads )
===> hobo   (89 bytes , 206reads )
被下面抢先了.... :-) hobo   (0 bytes , 163reads )
You can use <iomanip.h> => 魅力十足   (309 bytes , 329reads )