There are two things going on here - sorting the input in ascending order, and then counting the number of integers in a line.
So first off, you need a sorting algorithm to sort each line in ascending order. There are various sorting algorithms that you could use which you might want to Google. The easiest sort is the bubble sort, but this is the least efficient of the algorithms.
It may be easier to count the number of integers on each line first, then do the sorting.
We were all beginners at one time. The only way for you to learn is by coding it yourself, making mistakes, and learning how to correct your mistakes. There is a lot of self-satisfaction in knowing that you can accomplish something.