#include <iostream>
#include <sstream>
#include <climits>
std::string GetSmalletWord(std::string str) {
std::stringstream iss(str);
std::string smallest;
int min = INT_MAX;
std::string word;
while (iss >> word) {
if (word.size() < min) {
min = word.size();
smallest = word;
}
}
return smallest;
}
int main() {
std::string s = "c++ java c python java c# php c++";
std::cout << GetSmalletWord(s);
}
/*
run:
c
*/