scanf 格式控制字符串% [Reading Undelimited strings] *To read strings not delimited by whitespace characters, a set of characters in brackets ([ ]) can be substituted for the s (string) type character
The set of characters in brackets is referred to as a control string
The corresponding input field is read up to the first character that does not appear in the control string
If the first character in the set is a caret (^), the effect is reversed: The input field is read up to the first character that does appear in the rest of the character set
*Note that %[a-z] and %[z-a] are interpreted as equivalent to %[abcde
This is a common scanf function extension, but note that the ANSI standard does not require it
举一些例子: 对于 const char* p = "12232114687ABC12356"; sscanf(p,"%[123]",buf); // 就把是&#