On Wednesday, 30 December 2015 at 01:36:56 UTC, Michael S wrote:
auto matrix_size = readln;
Change that to auto matrix_size = readln.strip;and you should be in business. readln() returns any leading spaces and the newline character at the end of the line too, which is why to is throwing.
The .strip function will trim that whitespace off.