| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
cin.getline(str, MAX_NUM);In Reply To:用cin怎么读进带空格的string类型串? Posted by:forgotten at 2006-03-27 10:02:27 > msdn上关于noskipws有这样一段代码
>
> #include <iostream>
> #include <string>
>
> int main() {
> using namespace std;
> string s1, s2, s3;
> cout << "Enter three strings: ";
> cin >> noskipws >> s1 >> s2 >> s3;
> cout << "." << s1 << "." << endl;
> cout << "." << s2 << "." << endl;
> cout << "." << s3 << "." << endl;
> }
>
> 输入1 2 3
> 输出
> .1.
> ..
> ..
>
> 不知道noskipws的用法。。。
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator