Problem 400 -- Unix ls

read problem

Tips

A straight-forward problem. Steps include:

  1. Prepare two level char arrays for inputing and outputing. You can either use static declaration (at most 100 strings) or dynamically create the arrays according to size needed.
  2. Sort input strings. I use qsort.
  3. Find out column.
  4. Find out row
  5. Concate the input strings into output strings.
  6. Print out the output strings.