用于c数组

#include <iostream>     // std::cout
#include <numeric>      // std::accumulate

int main () {
  int numbers[] = {10,20,30};
  std::cout <<  std::accumulate(numbers,numbers+3,0);
}