Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
469 B
1
Indexable
Never
#include <iostream>
using namespace std;
int main()
{

	int mas[100];
	int n;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> mas[i];
	}
	cout << endl;
	for (int i = 0; i < n; i++)
	{
		for (int h = 0; h < n; h++)
		{
			if (mas[i] == mas[h] && i != h && mas[i] != - 449)
			{
				cout << mas[i];
				for (int q = 0; q < n; q++)
				{
					if (mas[i] == mas[q] && q != i)
					{
						mas[q] = -449;
					}
				}
			}
		}
	}
	return 0;
Leave a Comment