Contact: aviboots(AT)netvision.net.il
39,894 questions
51,825 answers
573 users
#include <iostream> #include <string> int main() { std::string str = "c c++ java python"; int n = 10; std::cout << std::string(str.rbegin() + n, str.rend()) << std::endl; } /* run: j ++c c */
#include <iostream> #include <string> int main() { std::string str = "c c++ java python"; int n = 6; std::cout << std::string(str.rbegin(), str.rend() - n) << std::endl; } /* run: nohtyp avaj */