Sir what is the problem with this code i am unable to understand

include <bits/stdc++.h>

using namespace std;
int main()
{
int t;
while (t–)
{
cin.get();
string str[100];
int n;
cin>>n;

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

    sort(str,str+n);
    reverse(str,str+n);

    for (int i = 0; i <n ; i++) {
        cout << str[i];
    }
    cout<< endl;
}

}

Hi Tarun. There is slight error in ur logic. you can just sort the number in decreasing order and form the biggest number.
Consider this sample input
1
4
54 546 548 60
Its output is 6054854654

But according to ur code 548 should come in the beginning.
Refer to this code https://ide.codingblocks.com/s/577801

Hope it clears all ur doubts

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.