Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Description
The exercise answer could not handle negative values:
template<typename ... T> autoaverage(T ... t){return (t + ... ) / sizeof...(t)} intmain(){std::cout << average(1, 2, 3, 4, 5, -6, -7, -8, -9, -10) << std::endl}It would return 1844674407370955159 on my side since it deduced the return value to be unsigned int.
Metadata
Metadata
Assignees
Labels
No labels