Line 11: You're using the string version of getline. while problem_set is declared as a char array. If you're going to use a char array, you want
|
cin.getline (problem_set, 256);
|
Or change problem_set to a std::string.
Line 14: You want to use strlen(), not sizeof, unless you change problem_set to std::string, then you want problem_set.size().
Line 16: i is uninitialized. You're going to be testing garbage.
Line 16-17: No need for two loops here. The termination condition of the two loops are the same.
Line 20: Where is j initialized? You're going to be setting your loop variable to garbage. It's not a good idea to change your loop variable inside your loop.
Line 22: You're introducing a new instance of a which is different from the variable declared on line 19.
Line 26: digits_after_dash is undefined.
Line 27: digits_before_dash is undefined.
Line 28: This for loop is going to change your outter loop variable. Are you sure you want to loop l times here?
Line 29: Where is dbd defined? range is undefined.
I don't see that your code handles two digit problem numbers.
Your code doesn't sort the problems. Your input example is out of order, but the example output is ordered.
Also, I don't see you allowing for spaces in the input.
Have you even tried to compile this?