Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define int long long
- signed main()
- {
- int n , m;
- cin >> n >> m; // matrix (2D massiv)-in olculeri
- int a[n + 5][m + 5]; // matrixin goturulmesi
- int sum = 0;
- for(int i = 1; i <= n; i++){ // setirin nomresi (yuxaridan asagi)
- for(int j = 1; j <= m; j++){ // sutunun nomresi (soldan saga)
- cin >> a[i][j]; // yuxaridan i - ci setirde, soldan j - ci sutunde olan eded
- sum += a[i][j];
- }
- }
- cout << sum << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement