Your solution is less powerful than other presented solutions.
Due to your explicite requirements only standard files can be
given, your program can't unleash the power of the magical
open. Your program can't reverse text given on standard input, or what comes from a pipe.