i
nt main()
{
int a[1000];
for(int i=0; i<sizeof(a)/sizeof(a[0]); i++)
{
for(int j=i+1; j<sizeof(a)/sizeof(a[0]);j++)
{
if(a[i]>a[j])
{
int temp;
temp = a[i];
a[i] = a[j];
a[j] = temp;
}
}
}
int count = 1;
for(int i=0; i<sizeof(a)/sizeof(a[0]);i++)
{
if(a[i]==a[i+1])
{
count++;
}
else
{
cout<<a[i]<<" "<<count<<" "<<endl;
count = 1;
}
}
}
{
int a[1000];
for(int i=0; i<sizeof(a)/sizeof(a[0]); i++)
{
for(int j=i+1; j<sizeof(a)/sizeof(a[0]);j++)
{
if(a[i]>a[j])
{
int temp;
temp = a[i];
a[i] = a[j];
a[j] = temp;
}
}
}
int count = 1;
for(int i=0; i<sizeof(a)/sizeof(a[0]);i++)
{
if(a[i]==a[i+1])
{
count++;
}
else
{
cout<<a[i]<<" "<<count<<" "<<endl;
count = 1;
}
}
}