Sort game salary arrangement in

#include
#include<bits/stdc++.h>
#include
using namespace std;

bool mycompare(pair<string,int> x,pair<string,int> y)
{

if(x.second==y.second)
{
	return x.first<y.first;
}
return x.second>y.second;

}
int main() {

int x;
cin>>x;

pair<string,int> employee;

int n;
cin>>n;
string name;
int salary;
for(int i=0;i<n;i++)
{
	cin>>name;
	cin>>salary;
	employee[i].first=name;
	employee[i].second=salary;

}

sort(employee,employee+n,mycompare);

	for(int i=0;i<n;i++)
{
	
	cout<<employee[i].first<<" "<<employee[i].second<<endl;

}

return 0;

}

Hey @arsh_goyal
pair<string,int> employee; should be an array. In your case it is just a pair.

If your issue is resolved please mark it as closed.

still not working help

@arsh_goyal
Please paste your code on CB IDE and send it once.

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.