Algorithm stl - sort game

#include
#include
using namespace std;

int main()
{
int x;
int n;
cin >> x;
cout << endl;
cin >> n;

string name[n];
int salary[n];

for (int i = 0; i < n; i++)
{
    cin >> name[i];
    cin >> salary[n];
}

int salary_1[100];
int count = 0;

for (int i = 0; i < n; i++)
{
   if (salary[i]<x)
   {
       salary_1[count]=salary[i];
       count++;
   }
       
}

for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
if (name[i]==name[j])
{
sort(name,name+n);
sort(salary_1,salary_1+count);
cout<<name<<" "<<salary_1;
}

}

}

return 0;

}

here is my code
please tell me the correct code

hi @sahilkumar23102003_bbf6ee38349d98a1,
refer here ive commented the code well https://ide.codingblocks.com/s/662091

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.