新手异常求指正

新手错误求指正
//读入一段文本到vector对象,每个单词存储为vector中的一个元素。
//把vector对象中每个单词转化为大写字母。
//输出vector对象中转化后的元素,每8个单词为一行输出
#include <iostream>
#include <string>
#include <vector>
#include <cctype>
using namespace std;

int main()
{
vector<string> svec;
string str;

//计入文本到vector对象
cout << "Enter text Ctrl+Z to end:" <<endl;
while(cin<<str)
svec.push_back(str);

//将vector对象中每个单词转化为大写字母,并输出
if (svec.size()==0) {
cout<< "No string?!" << endl;
return -1;
}
cout<< "Transformed elements from the vector:"<<endl;
for (vector<string>::size_type ix=0;ix != svec.size();++ix)
{for(string::size_type index=0;index != svec[ix].size();++index)
if(islower[svec[ix][index]])
//单词中下标为index的字符为小写字母
svec[ix][index]=toupper(svec[ix][index]);
cout << svec[ix] << " ";
if((ix+1)%8<0) //每8个单词为一行输出
cout << endl;
}
return 0;
}



错误:vector(3-14).cpp(17) : error C2784: 'class std::basic_ostream<_E,_Tr> &__cdecl std::operator <<(class std::basic_ostream<_E,_Tr> &,const class std::basic_string<_E,_Tr,_A> &)' : could not deduce template argument for 'c
lass std::basic_ostream<_E,_Tr> &' from 'class std::basic_istream<char,struct std::char_traits<char> >'



跪求指点!!!!!!

------解决方案--------------------
while(cin<<str)
->

while(cin>>str)
------解决方案--------------------
探讨
while(cin<<str)
->

while(cin>>str)

------解决方案--------------------
关于自己是否适合编程的很简单的测试:
在报纸或杂志上随便找一段约1000字的文章,在Word中输入一遍。输完后再参考下面答案:

A里面有10处以上文字或标点错误
B里面没有文字或标点错误并敢为此跟人打赌
C里面没有文字或标点错误并且字体和排版完全与原稿一致
D打印在半透明的纸上和原稿重叠在一起检查一模一样,且自我感觉很有成就感

A不适合编程(理由:打字准确度偏低、粗心大意)
B初级程序员(理由:打字准确度很高、认真细致、自信、理解全角半角概念)
C高级程序员(理由:在B的基础上理解字体和排版也是电脑打印的重要因素、但相比D还不够偏执、精益求精、结果可验证)
D软件项目经理(理由:能针对项目给出令人信服的细致到极点的需求说明和典型测试用例。用户几乎挑不出毛病。专业!)

如果想从A变成B的话,到我的资源http://download.****.net/detail/zhao4zhong1/4084259里面下载“适合程序员的键盘练习”

------解决方案--------------------
错了要慢慢分析。。