Generally, we expect you to put forth some effort and show any code you've tried so far. If you're having trouble even getting started with a hello world type program, check out some basic
tutorials.
Pretend you're the computer. Describe in English what it is you would do to solve this as the computer. Something like:
Grab all the text up to the # character
Split it up at each ;
...
Then, convert each of those steps to code, one at a time, and test your code at each step. Make sure it works perfectly before moving on to the next step.
Some functions you might find helpful:
strtok/strtok_r would be good for splitting up a line at certain characters (like ; ) into chunks that have the same format (i.e. pairs or ranges of numbers).
strchr to find a character within a given string.
strtol to convert a string of digits to an integer
sscanf to parse a string of a given format and extract formatted data, like numbers.
Give it your best shot, and post your attempt here, in [code][/code] tags, and please make sure it's well-formatted since it makes it easier for us to help you
.