COMP2004 Programming Practice
2002 Summer School
Week 6 Friday Tutorial Exercises
Enter the example find_if code from today's lecture. You can use this line to read in int values from cin:
copy(istream_iterator<int>(cin), istream_iterator<int>(), back_inserter(l));
Modify this code so that it outputs the first and the second negative numbers in the list.
Modify your solution to Question 1 so that all of the negative numbers in the list are output.
Modify your solution to Question 2 so that the
function isn't needed. (Hint: Try using
Rewrite the split() function from Question 7 of the
Week 1 Friday
tutorial so that it uses the generic algorithms from
instead of the methods of the string class.
Experiment with the rest of the code examples from the lecture, make sure you understand why they do what they do.
Continue working on your Assignment 3 solution.