Thanks for your answer! I supposed it could be a "new line symbol" problem, but I can not solve it. What would you modify in code? Or should I read hour,minute,phonenumber with getline (if possible) also?
This line skips all symbols before and with first encountered newline symbol.
You can use just std::cin.ignore(100, '\n'); if you can be sure that there won't be more than 99 whitespace characters at the end of first line.
If you want to rewrite program using getline, there is two ways:
a) Get the whole first string, assign it to the stringstream and get values from it