Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
2d array sum
//g++ 7.4.0 #include <iostream> using namespace std; int main() { int sum=0; int n,m; cin>>n>>m; int** p= new int* [n]; for(int i=0; i < n; i++){ p[i]=new int [m]; for (int j=0; j < m; j++){ cin>>p[i][j]; } } for(int k=0;k<n;k++){ for(int t=0;t<m;t++){ sum=sum+p[k][t]; } } cout<<sum; }
run
|
edit
|
history
|
help
0
Best time to buy and sell stocks
Funny Writings
Stream4
Reverse a string
Dar
Default copy
多态
HeapSort
10 wizards-DFS_vector
C++ Car Racing game framework