First decide what you consider acceptable values.
Is "abcdefgh" acceptable? If not, why not?
How about "20189999"? If not, why not?
What about "20170801"?
Once you've decided what is, and is not, acceptable, you're half way there. Write out your tests for acceptable input.
Get the input from the user, as a string.
You can get the length of the string with the string::length() member function.
http://www.cplusplus.com/reference/string/string/
You can check the value of each character in the string.
You can build substrings for testing out of the whole string.
Apply your tests. If any fail, the string is unacceptable.
Do it in small pieces. Write out your tests, and then start simply by taking a string input from the user.
http://www.cplusplus.com/doc/tutorial/basic_io/
Apply