1. String to real Write a function similar to strtod which takes as parameter a string and returns the real number represented by that string. Accept as much of C syntax as possible: initial whitespace, optional sign, optional integer and fractional parts (not both missing), optional exponent and sign.
2. Ints in string Write a function that prints out all numbers (strings of digits with optional sign) from a string given as parameter. Consider only numbers that are not adjacent to any non-whitespace.
3. The Nth field Write a function that reads from input lines that contain numbers separated by commas (and possibly also whitespace), and prints the Nth number from each line. N is a constant defined in the program. Numbers may be missing between two commas, or there may be fewer than N numbers on a line. In either of these cases, print 0.
4. Searching for words
Write a program that counts the number of nonoverlapping occurrences
of a word in the input.
The word is a string constant in the program
(or you may write int main(int argc, char *argv[]) and use argv[1], running the program with a command line argument).
a) Consider only standalone words
b) Count also occurrences as substrings in other words
Handle the case where the words in the input may be arbitrarily long.
6. Running times Write a program that reads from input a list of finishing times in a race (given in increasing order), in the form h:mm:ss, one per line. Print the winning time on a line, and for each of the other finishing times, the difference with respect to the previous time, and with respect to the winning time. For example, for the input
3:51:38 4:05:47 4:11:28the program should print
3:51:38 +0:14:09 0:14:09 +0:05:41 0:19:50
7. Structured text The .srt format for subtitles has the following structure. Each subtitle group is formed of four parts, on separate lines
8. Conjunctive normal form The DIMACS format for a logic formula in conjunctive normal form contains: