Define a function IsMore() that takes two integer vector parameters. The function returns true if the two vectors have the same size, and every element in the first vector is greater than the element at the same index in the second. The function returns false otherwise.
Ex: If the input is 3 -12 -14 15 3 -13 -17 12, the first vector has 3 elements {-12, -14, 15} and the second vector has 3 elements {-13, -17, 12}. Then, the output is:
True, the first vector is element-wise greater than the second vector.
#include
#include
using namespace std;
/* Your code goes here */
int main() {
int i;
vector inputVector1;
vector inputVector2;
int size;
int input;
bool checkProperty;
cin >> size;
for (i = 0; i < size; ++i) {
cin >> input;
inputVector1.push_back(input);
}
cin >> size;
for (i = 0; i < size; ++i) {
cin >> input;
inputVector2.push_back(input);
}
checkProperty = IsMore(inputVector1, inputVector2);
if (checkProperty) {
cout << "True, the first vector is element-wise greater than the second vector." << endl;
}
else {
cout << "False, the first vector is not element-wise greater than the second vector." << endl;
}
return 0;
}