我需要帮助创建一个excel公式。我在A列中有一组数字,我需要在单元格B1中返回一个公式:
答案 0 :(得分:0)
vector<long> vectorAddCheck(vector<long> x, long value){
if(x.empty()){
x.push_back(value);
}
else {
for(int i = 0; i < x.size(); i++){
if(x[i] < value){
x[i] = value;
}
}
}
return x;
}
int main() {
long numLines, numOutputs, temp;
vector<long> outputList = {};
cin >> numLines >> numOutputs;
for(int i = 0; i < numLines; ++i){
cin >> temp;
outputList = vectorAddCheck(outputList, temp);
}
for(int i = 0; i < outputList.size(); i++){
cout << outputList[i] << endl;;
}
return 0;
}