You can try this =>
所在版块:求学狮城 发贴时间:2003-03-13 00:31

用户信息
复制本帖HTML代码
高亮: 今天贴 X 昨天贴 X 前天贴 X 
A very intuitive way to do it:

#include<iostream.h>
#include<string>
using std::string;
main(void)
{
string text( "Hello! I want it that way" );
int number=0;

cout << "Please enter the number of characters you want to display"
<< endl;
cout << flush;
cin >> number;

for(int i=0;i<number;i++)
cout<<text[i];
cout << endl;

return 0;
}// end of the source code.


Right now, I don't know any build-in functions to do that. :)

Any way, Good good study, day day up!!!

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

Put your OWN COOL signature here!
 相关帖子 我要回复↙ ↗回到正文
请问:关于c++左端对齐... notice   (104 bytes , 420reads )
再问:关于c++的问题 notice   (91 bytes , 211reads )
You can try this => 魅力十足   (489 bytes , 332reads )
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 )