Task: Given a sequence of real numbers a1, a2, ..., an (n> = 2 and unknown in advance). If the sequence is ordered not to decrease, then leave it unchanged, otherwise get the sequence an, a (n-1), ...., a1.
I was given only linear lists and a function fopen (fopen_s) at the university. I read all the top articles from Google, I figured it out in lists, but I don’t understand how to solve this problem using lists. Please help me with an idea or with examples of solutions for similar problems.