Code for problem 74.
Added code to get matrix from stdin.