Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main() {
- int n;
- int count = 0;
- cin >> n;
- vector <int> a(n);
- vector <int> b(n);
- //считывание
- for (int i = 0; i < n; i++) {
- int temp;
- cin >> temp;
- a.push_back(temp);
- }
- //обработка и вывод
- for (int j = 0; j < a.size(); j++) {
- for (int i = 0; i < n; i++) {
- if (a[j] == a[i]) {
- count = count + 1;
- }
- }
- if (count == 1) {
- b.push_back(a[j]);
- }
- }
- for (int i = 0; i < n; i++) {
- cout << b[i] << " ";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement