Parsing formatted user input in C++
问题 For a project I need to implement a solution to the graph coloring problem. However, the input is required to have specific syntax with which I have no idea on how to parse through in order to access the data needed to store in variables. The input constraints are to first enter the number of colors, then the number of vertices, followed by a sequence of edges. The edges should be entered in the format (v1 v2) . The sequence is terminated with v1 = -1. So, (-1 0) , (-1 -1) , etc. So the input