Не могу понять в чём ошибка, не считает сумму и количество

#include <algorithm>
#include <iostream>
#include <random>
#include <iomanip>
#include <numeric>
using namespace std;
int integer(const char* msg) {
cout << msg;
int value;
cin >> value;
return value;
}
int main() {
uniform_int_distribution<> uid(-50, 50);
mt19937 gen{ random_device()() };
auto rand = [&] {
return uid(gen);
};
auto show = [](int x) {
cout << setw(4) << x;
};
int box[40];
generate(begin(box), end(box), rand);
for_each(begin(box), end(box), show);
puts("");
auto a = integer("a: ");
int b;
do b = integer("b: "); while (b <= a);
auto range = [a, b](long long s, int x) {
return x >= a && x <= b? s += x : s;
};
auto s = accumulate(begin(box), end(box), 0LL, range);
auto between = [a, b](int x) {
return x >= a && x <= b;
};
auto q = count_if(begin(box), end(box), between);
cout
<< "Sum: " << s << '\n'
<< "Quantity: " << q << '\n';
system("pause > nul");
}
& и && это разные операции.
upd
ну и и тело цикла в фигурных скобках должно быть, если в нем больше одного оператора
1.Пишите and вместо & чтоб не ошибиться
2. Возьмите всё по нормальному в скобки, чтобы ТОЧНО знать что и где у вас происходит
3 Вместо +=1 пишут ++