Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int a[15][15], d[15], n;
- void citire(int & n, int a[15][15]) {
- cin >> n;
- for (int i = 1; i < n; i++)
- a[i][i] = 0;
- for (int i = 1; i < n; i++)
- for (int j = i + 1; j <= n; j++) {
- cout << "a[" << i << "][" << j << "]=";
- cin >> a[i][j];
- a[j][i] = a[i][j];
- }
- }
- void grade(int n) {
- for (int i = 1; i <= n; i++) {
- d[i] = 0;
- for (int j = 1; j <= n; j++)
- d[i] += a[i][j];
- }
- }
- void afisare_grade() {
- for (int i = 1; i <= n; i++)
- cout << d[i] << " ";
- }
- int main() {
- citire(n, a);
- grade(n);
- afisare_grade();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement