|
|
|
|
复制本帖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!
|
|