我正在忙着处理我的C ++书籍,似乎无法在没有错误的情况下运行#34; [错误]' vector'未在此范围内宣布"
#include <iostream>
using namespace std;
int main(){
string word;
string previous;
string current;
vector<string> dislikes(4);
dislikes [0] = "bob";
dislikes [1] = "cat";
dislikes [2] = "pineapple";
dislikes [3] = "stackoverflow";
while(cin >> current){
for(i = 0; i<dislikes.size(); ++i){
if(current==dislike[i]){
cout << "BLEEP ";}
else{cout << current << " "}
}
previous = current;
}
}
return 0;
}
答案 0 :(得分:4)