1. (20 scores)

1. (20 scores)#

Write two function template:

  • A function template named sort that sorts an array in non-descending order.

  • A function template named search that binary searches the non-descending array.

In the main function, define a 10-element integer and string array, randomly generate 10 integer number (in the range of \([0, 100]\)) and read in 10 strings, call function sort, and then arbitrarily read in a number and a string, call function template search, output search results.