почему так?
int a; // -32767 - 32767
unsigned int b; // 0 - 65535
document.querySelector('.result').innerText =
[...document.querySelectorAll('.sum')].reduce((acc, n) => acc + +n.innerText, 0);
void Reverse (int *a, int x, int y) {
int i = y+1;
int j = x-1;
while (i < j) {
int tmp = a[i];
a[i] = a[j];
a[j] = tmp;
i++;
j--;
}
}
for (int i=x+1, j = y-1; i < j; i++, j--) {
std::swap(a[i], a[j]);
}
std::reverse( &a[x+1], &a[y]);