home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume17 / contest-prog / part01 / prob3.txt < prev    next >
Encoding:
Text File  |  1989-02-06  |  753 b   |  27 lines

  1. Problem 3: Reverse the characters in a line.
  2.  
  3. For each line in a file (on the standard input), reverse
  4. the order of the characters in the line.
  5.  
  6. There is an unknown, but fairly small (less than ten thousand)
  7. number of lines in the input file.
  8.  
  9. Each line is guaranteed to be less than 80 characters long.
  10.  
  11. For example, if the file on stdin consists of exactly two lines:
  12.  
  13. hello
  14. world!
  15.  
  16. then the output should be
  17.  
  18. olleh
  19. !dlrow
  20.  
  21. on exactly two lines.  The byte count of a correct output for the
  22. example would be 13 (remember that the newlines count as bytes).
  23. The blank lines in the above listing of the explanation are not 
  24. part of the output.  Note that each output line should be left-
  25. justified (e.g., the ! in the example must come out in column 1).
  26.  
  27.