I'm given a text file with countries, names and scores of skating competitors. I have to read each line into an array, then sort the array in descending order.
I managed to get everything organized like this:
infoArray[0][0] = "GER";
infoArray[0][1] = "Nathalie WEINZIERL Maylin & Daniel Peter LIEBERS Nelli & Alexander";
infoArray[0][2] = "17.0";
infoArray[1][0] = "RUS";
infoArray[1][1] = "Evgeny PLYUSHCHENKO Tatiana & Maxim Yulia LIPNITSKAYA Ekaterina & Dmitri"
infoArray[1][2] = "37.0";
infoArray[2][0] = "CHN";
infoArray[2][1] = "Kexin ZHANG Han YAN Cheng & Hao Xintong & Xun"
infoArray[2][2] = "20.0"
And so on for 10 different countries.
What I need now is to display the 10 different countries by descending order using the third column, which is the numeric value (though it's in string format).
So in other words I want the output of those three countries to be:
RUS: 37.0
CHN: 20.0
GER: 17.0
I thought about using nested loops but can't quite grasp how I could get that to work.