#include<bits/stdc++.h> using namespace std; typedef long long int64;
class Solution {
public:
static vector
switch (n0) {
case 0:
// 没有0的情况
for (int num : nums) {
p *= num;
}
for (auto &it: nums) {
it = p / it;
}
return nums;
case 1:
// 只有一个0的情况
for (int num : nums) {
p *= num ? num : 1;
}
for (auto &it: nums) {
it = it ? 0 : p;
}
return nums;
default:
// 有两个以上的零的情况
return vector(nums.size(), 0);
}
}
};