- 论坛徽章:
- 0
|
我在vc下这个程序能编过去,可是在linux
#include <iostream>;
#include <vector>;
#include <algorithm>;
#include <string>;
using namespace std;
int main()
{
vector<string>; coll;
copy(istream_iterator<string>;(cin),
istream_iterator<string>;(),
back_inserter(coll));
sort(coll.begin(), coll.end());
unique_copy(coll.begin(), coll.end(),
ostream_iterator<string>;(cout, "\n" );
}
[youyou@sudy STL]$ gcc -o io io.cpp
io.cpp: In function `int main()':
io.cpp:11: error: `istream_iterator' undeclared (first use this function)
io.cpp:11: error: (Each undeclared identifier is reported only once for each
function it appears in.)
io.cpp:11: error: syntax error before `>;' token
io.cpp:17: error: `ostream_iterator' undeclared (first use this function)
io.cpp:17: error: syntax error before `>;' token |
|