📄 12-10-01.cpp
字号:
#include <iostream>#include <iterator>#include <functional>#include <numeric>using namespace std;int main(){ int A[] = {1, 2, 3, 4, 5}; const int N = sizeof(A) / sizeof(int); cout << "The sum of all elements in A is " << accumulate(A, A + N, 0) << endl; cout << "The product of all elements in A is " << accumulate(A, A + N, 1, multiplies<int>()) << endl;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -