#include <numeric>
#include <iostream>

int getTotal(const char* value, int start, int end)     
{
	return std::accumulate(value + start, value + end, 0, [](int n, char ch){ return n * 10 + (ch-'0');});
}

int main()
{
	char value[8] = {'1','2','3','4','0','0','1','4'};
	int total1 = getTotal(value, 0, 4);
	int total2 = getTotal(value, 4, 8);
	std::cout << total1 << " " << total2;
}