Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- bool areEqual(int arr1[], int length1, int arr2[], int lenght2) {
- if (length1 != lenght2) {
- return false;
- }
- for (int i = 0; i < length1; i++) {
- if (arr1[i] != arr2[i]) {
- return false;
- }
- }
- return true;
- }
- int main() {
- int length1, element, length2;
- cin >> length1;
- int* arr1 = new int[length1];
- for (int i = 0; i < length1; i++) {
- cin >> element;
- arr1[i] = element;
- }
- cin >> length2;
- int* arr2 = new int[length2];
- for (int i = 0; i < length2; i++) {
- cin >> element;
- arr2[i] = element;
- }
- cout << (areEqual(arr1, length1, arr2, length2) ? "equal" : "Not equal") << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement