Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int Array[10], Current = -1, ArrayMax = 1;
- cout << "Enter array elements (10) :" << endl;
- for (int i = 0; i < 10; i++) cin >> Array[i];
- cout << endl;
- for (int i = 0; i < 10; i++)
- {
- int Counter = 0;
- for (int j = i; j < 10; j++)
- {
- if (Array[i] == Array[j])
- Counter++;
- }
- if (ArrayMax < Counter)
- {
- ArrayMax = Counter;
- Current = i;
- }
- }
- if (Current > -1) cout << Array[Current] << endl;
- else cout << "No repeating elements" << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement