剑指offer---构建乘积数组

class Solution 
{
public:
    vector<int> multiply(const vector<int>& A) 
    {
        vector<int> result;
        int size = A.size();
        for (int i = 0; i < size; ++i)
        {
            int chengji=1;
            for (int j = 0; j < size; ++j)
            {
                if (i!=j    )
                {
                    chengji = chengji*A[j];
                }
            }
            result.push_back(chengji);
        }
        return result;
    }
};
原文地址:https://www.cnblogs.com/159269lzm/p/7282544.html