这个题的错误和c++ primier中名字的作用域例子相似。只是这里将int换成了vecto<int>这种形式。

```class Solution {
public:
vector<int> multiply(const vector<int>& A) {
int length = A.size();
vector<int> B;
if(length <= 1)
return B;
else
vector<int> B(length,1);
for(int i = 1;i < length;i++){
B[i] = B[i-1] * A[i-1];
}
int tmp = 1;
for(int j = length-2;j >= 0;j--){
tmp *= A[j+1];
B[j] *= tmp;
}
return B;

}
};```

```class Solution {
public:
vector<int> multiply(const vector<int>& A) {
int length = A.size();
vector<int> B;
if(length <= 1)
return B;
else{
vector<int> B(length,1);
for(int i = 1;i < length;i++){
B[i] = B[i-1] * A[i-1];
}
int tmp = 1;
for(int j = length-2;j >= 0;j--){
tmp *= A[j+1];
B[j] *= tmp;
}
return B;
}
}
};```

```class Solution {
public:
vector<int> multiply(const vector<int>& A) {
int length = A.size();
vector<int> B;
if(length <= 1)
return B;
else
B = vector<int> (length,1);
for(int i = 1;i < length;i++){
B[i] = B[i-1] * A[i-1];
}
int tmp = 1;
for(int j = length-2;j >= 0;j--){
tmp *= A[j+1];
B[j] *= tmp;
}
return B;

}
};```