Update rational.cpp

now uses std::stoi instead of custom strToInt