template <typename T>
T algorithm(T* start, T* end, T total)//把[start, end)标记范围内所有元素累加到total中
{
while (start != end)
{
total += *(start++);
}
return total;
}
template <typename T>
T algorithm(T* start, T* end, T total)//把[start, end)标记范围内所有元素累加到total中
{
while (start != end)
{
total += *(start++);
}
return total;
}