following is the custom input:-
2
4 10
1 2 3 4
3 10
1 2 3
following is the code:-
using namespace std;
class shopping
{
public:
int Rs,N,number;
int mall_items[10000];
};
int main()
{
int T;
cin>>T;
shopping shop[T];
for(auto s:shop)
{
cin>>s.N>>s.Rs;
for(int i=0;i<s.N;i++)
{
cin>>s.mall_items[i];
}
for(int i=0;i<s.N-1;i++)
{
for(int j=0;j<(s.N-i-1);j++)
{
if(s.mall_items[j]>s.mall_items[j+1])
{
int x;
x=s.mall_items[j];
s.mall_items[j]=s.mall_items[j+1];
s.mall_items[j+1]=x;
}
}
}
}
for(auto s:shop)
{
for(int i=0;i<s.N;i++)
{
cout<<s.mall_items[i]<<" ";
}
cout<<endl;
}
}