i would do it with vector.
push_back() each world of a line, untill you find '\n' or eof() then print from the end.
in your code, i think, you need to increase the capacity of line16
and in for(int i=1; i<=(n+1); ++i) seems you run one extra time!
Last edited on