Răspuns:
Explicație:
Răspuns:
#include <iostream>
using namespace std;
int main()
{
unsigned int n,i,x;
cout<<"n=";
cin>>n;
long a[n],b[100000]={0};
for(i=0;i<n;i++)
{
cout<<"a["<<i<<"]=";
cin>>a[i];
}
for(i=0;i<n;i++)
{
x=a[i];
b[x]++;
}
for(i=100000;i>0;i--)
if(b[i]==2)
cout<<i<<" ";
return 0;
}