帮我看看哪里的问题!
Compiling...
test.cpp
D:\my\CPP\temp\test.cpp(11) : error C2677: binary '||' : no global operator defined which takes type 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' (or there is no acceptable conversion)
Error executing cl.exe.
test.obj - 1 error(s), 0 warning(s)
主要是看不懂什么意思啦
呵呵
以下是程序
#include <iostream>
#include <string>
using namespace std;
int main(){
int numberofwords=0;
int numberofarticles=0;
string s;
cout<<"Enter text for analysis"<<endl<<endl;
while (cin>>s){
++numberofwords;
if ((s=="the")||(s="The")||(s=="an")||(s=="An")||(s=="a")||(s=="A")){
++numberofarticles;
}
}
cout<<endl;
cout<<"Text contains "<<numberofwords<<" words of which "<<numberofarticles<<" are article"<<endl;
return 0;
}