Hi guys. can you please make this code for the 3 largest elements?


#include<iostream>
#include<ctime>
#include<stdlib.h>
using namespace std;
int main ()
{
srand(time(NULL));
int n,max1,max2;
cout<<"n = ";cin>>n;
int *N=&n;
int A[n];
int *a[*N];
A[1]=rand()%200-100;
a[1]=&A[1];
cout<<"a["<<1<<"] = "<<*a[1]<<endl;
max1=*a[1];
max2=max1;
for (int i=2;i<=*N;i++)
{
A[i]=rand()%200-100;
a[i]=&A[i];
cout<<"a["<<i<<"] = "<<*a[i]<<endl;
if (max1<*a[i])
{
max2=max1;
max1=*a[i];
}
}
cout<<"The two largest elements = "<<max1<<" and "<<max2;
return 0;
}