关于使用using std:cin;与使用using namespace std;的有关问题?

关于使用using std::cin;与使用using namespace std;的问题??
各位大侠,小弟碰到一个老生长谈的问题,是这样的,本人谢了段如下代码,用到了set容器,在主函数外面如果用using namespace std;则一下代码能够顺利通过并运行,但是如代码所述,使用
using std::cin;
using std::cout;
using std::endl;
则会报出一大堆的错误,主要是说找不到set,string等等头文件,错误显示如:
C:\Documents and Settings\Administrator\桌面\MYOWNTESTPROGRAM\MapTest\MapTest.cpp(15) : error C2065: 'set' : undeclared identifier
C:\Documents and Settings\Administrator\桌面\MYOWNTESTPROGRAM\MapTest\MapTest.cpp(15) : error C2065: 'string' : undeclared identifier
C:\Documents and Settings\Administrator\桌面\MYOWNTESTPROGRAM\MapTest\MapTest.cpp(15) : error C2065: 'excluded' : undeclared identifier
可是我明明添加了头文件的啊,小弟很纠结,这个具体原因是为什么呢?

代码如下:
#include "stdafx.h"
#include <set>
#include <string>
#include <iostream>
using std::cin;
using std::cout;
using std::endl;


int main(int argc, char* argv[])
{
set<string> excluded;

string readedBooks;
while(cin>>readedBooks && readedBooks!="q")
excluded.insert(readedBooks);
cout<<"The input is:"<<endl;
for (set<string>::iterator iter=excluded.begin();iter!=excluded.end();++iter)
{
cout<<*iter<<endl;
}
return 0;
}

------解决方案--------------------
1、using namespace std
2、using std::string  using std::set ...
3、定义对象的时候加std:: ,如 std::string str 
以上3个方法任选其一。