Answer:
The solution code is written in C++
- string usermonth;
- int userdate,useryear;
-
- string userinput = "jan 12 1992";
- istringstream inss;
- inss.str(userinput);
-
- inss>> usermonth>>userdate>>useryear;
-
- cout<<usermonth<<" "<<userdate<<" "<<useryear;
Step-by-step explanation:
Firstly, declare three variables, usermonth, userdate and useryear (Line 1-2).
Next declare another variable userinput to hold the input string (Line 4). Create an input string object, inss (Line 5) that can read the input string (Line 6). Once the input string is read into inss, we can use >> operator to update variable usermonth, userdate, and useryear (Line 8).
We print the value of usermonth, userdate, and useryear at console terminal (Line 10) and we shall get:
jan 12 1992