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
MINVEST
Pointer to class members
Simulare 2022
BST to DLL
2015(M2)Simulare
Вывод элементов массива
const test
memcpy
use of assert to check a particular situation! (throws error)
cache 内存消耗