Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- cout << "Введите количество элементов массива: ";
- int n;
- cin >> n;
- cout << endl;
- int* mass = new int[n];
- cout << "Введите значения элементов массива:";
- for (int i = 0; i < n; i++)
- {
- cout << "mass[" << i << "] = ";
- cin >> mass[i];
- }
- int uniq_num = n;
- for (int i = 0; i < n; i++)
- {
- for (int j = 0; j < n; j++)
- {
- if (mass[i] == mass[j] && i != j)
- {
- uniq_num--;
- }
- }
- }
- cout << uniq_num << " uniq_num";
- delete[]mass;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement