Вы находитесь на странице: 1из 1

#include <iostream.

h> void citm(int &n, int x[][5]) { cout << "n="; cin >> n; cout << "val mat pe linii\n"; for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) cin >> x[i][j]; } int sumi(int i, int n, int x[][5]) { int j, s = 0; for (j = 0; j < n; j++) s+= x[i][j]; return s; } void main() { int n, i, mat[5][5]; citm(n, mat); for (i = 0; i < n; i++) cout << "linia " << (i + 1) << " are suma" << sumi(i, n, mat) << endl; }

Вам также может понравиться