#include <iostream>
#include <string>
int main()
{
using namespace std;
string str = "c++ c c# python java";
const auto pos = str.find_last_of(" \t\n");
pos == string::npos ? str : str.substr(pos + 1);
cout << "pos = " << pos << endl;
cout << str.substr(pos + 1) << endl;
return 0;
}
/*
run:
pos = 15
java
*/