标准模板8

#include<iostream>

#include<numeric>

#include<functional>

using namespace std;

int main()

{

int a[]={1,2,3,4,5};

const int N=sizeof(a)/sizeof(int);

cout<<"The result by multipling all elements in A is "<<accumulate(a,a+N,1,multiplies<int>())<<endl;

return 0;

}

posted @ 2023-05-11 13:30  不会JAVA的小袁  阅读(6)  评论(0编辑  收藏  举报