fixed rot45.cpp

Got this working by replacing arrays with vectors, and found a stubborn
bug caused by the wrong counter being incremented in a for loop (line
77)