STL Algorithms exercises
- Create a sequence containing 1, 50, 3, 9, 18
- Use
find_if
to locate the fist element divisible by 5
- Create a string containing "algorithms are fun"
- Use
search
to locate the sub string "are" and print its starting position
- Create a sequence containing 1, 200, 5, 7, 900
- Use
copy_if
to copy all elements >100 to another sequence - Use
copy
to the output stream to print the result
- Create a sequnce containing 2,3,4,5
- Use
transform
to double each value in the sequence and store in another sequnce - Print the result
- Create a string containing "aaccdffgfgfgiili"
- Use
sort
,unique
and stringerase
to get "acdfgil"
- Create a sequence containing 1,500,345,6,3,6
- Use
stable_partition
to get 500,345,1,6,3,6
- Create a sequence containing 1,500,345,6,3,6
- Use
count_if
to calculate number of elements >100