Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- using namespace std;
- int main()
- {
- setlocale(LC_ALL, "russian");
- float i, j;
- cout << "Введите кол-во строк и столбцов в массиве: ";
- cin >> i >> j;
- float **arr = new float*[i];
- for (int n = 0; n < i; n++)
- arr[n] = new float[j];
- for (int n = 0; n < i; n++) {
- for (int z = 0; z < j; z++) {
- cin >> arr[n][z];
- }
- }
- float summ=0;
- for (int n = 0; n < i; n++) {
- for (int z = 0; z < j; z++) {
- summ += arr[z][n];
- }
- }
- cout << "Сумма элементов равна: " << summ << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement