Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void findRepeats(int numbers[], int num)
- {
- int instances = 0;
- cout << "Number" << " " << "Occurrences" << endl;
- for (int i = 0; i < num; i++)
- {
- bool matching = false;
- instances = 1;
- for (int j = 0; (j < i); j++)
- {
- if (numbers[i] == numbers[j])
- {
- instances++;
- matching = true;
- }
- }
- if (!matching)
- cout << numbers[i] << " " << instances << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement