Why would a programmer want to use string streams, specifically objects of istrstream and ostrstream classes, for handling input to and output of a program?
Each line has different number of values. Not known beforehand.
We can std::getline one line into std::string. Then read integers via istringstream. Repeat for each line.
Besides, not all I/O is with console or file. You are reading this post with a browser, don't you? The browser receives HTML string from network connection. Then it has to parse the "input". Not reading a file, not waiting for the user to type. Yet, a browser could open a local file. Therefore, the parsing code probably takes a generic istream and it is called with either ifstream or istringstream object.