#include <iostream>
#include <iterator>
#include <string>
template <typename T>
T paramTest(const T* arr, std::size_t index)
{
return arr[index];
}
template<typename T, typename... Args>
T paramTest(const T* arr, std::size_t index, Args... args)
{
return arr[index] + paramTest(arr, args...);
}
int main()
{
int p[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
int sum = paramTest(p, 5, 4, 7);
std::cout << sum;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8aXRlcmF0b3I+CiNpbmNsdWRlIDxzdHJpbmc+Cgp0ZW1wbGF0ZSA8dHlwZW5hbWUgVD4KVCBwYXJhbVRlc3QoY29uc3QgVCogYXJyLCBzdGQ6OnNpemVfdCBpbmRleCkKewogICAgcmV0dXJuIGFycltpbmRleF07Cn0KCnRlbXBsYXRlPHR5cGVuYW1lIFQsIHR5cGVuYW1lLi4uIEFyZ3M+ClQgcGFyYW1UZXN0KGNvbnN0IFQqIGFyciwgc3RkOjpzaXplX3QgaW5kZXgsIEFyZ3MuLi4gYXJncykKewogICAgcmV0dXJuIGFycltpbmRleF0gKyBwYXJhbVRlc3QoYXJyLCBhcmdzLi4uKTsKfQoKaW50IG1haW4oKQp7CiAgICBpbnQgcFsxMF0gPSB7IDAsIDEsIDIsIDMsIDQsIDUsIDYsIDcsIDgsIDkgfTsKICAgIGludCBzdW0gPSBwYXJhbVRlc3QocCwgNSwgNCwgNyk7CiAgICBzdGQ6OmNvdXQgPDwgc3VtOwoKfQ==