Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template <typename T>
- T searchMax(const T* array, int size)
- {
- T max = array[0];
- for (int i = 0; i < size; i++)
- if (max < array[i])
- max = array[i];
- return max;
- }
- int main()
- {
- ТИПМАССИВА array [len] = САММАССИВ
- cout << "Максимальный элемент массива типа int" << endl;
- cout << searchMax(iArray, len) << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement