#include <stdio.h>
void conta(int matriz[5][3], int * vet)
{
for (int i = 0 ; i<5; i++)
{
for (int j = 0; j<3;j++)
{
matriz [i][j] = i+j;
vet[i] += matriz[i][j];
}
}
}
void imprimir(int matriz[5][3], int * vet)
{
for (int i = 0 ; i<5; i++)
{
for (int j = 0; j<3;j++)
{
}
}
for (int i = 0; i < 5; ++i)
{
printf("soma linha %d : %d \n", i
, vet
[i
] ); }
}
int main()
{
int matriz [5][3];
int vet[5] = {0};
conta(matriz,vet);
imprimir(matriz,vet);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CnZvaWQgY29udGEoaW50IG1hdHJpels1XVszXSwgaW50ICogdmV0KQp7CiAgICBmb3IgKGludCBpID0gMCA7IGk8NTsgaSsrKQogICAgewogICAgICAgIGZvciAoaW50IGogPSAwOyBqPDM7aisrKQogICAgICAgIHsKICAgICAgICAgICAgbWF0cml6IFtpXVtqXSA9IGkrajsKCiAgICAgICAgICAgIHZldFtpXSArPSBtYXRyaXpbaV1bal07CiAgICAgICAgfQogICAgfQp9Cgp2b2lkIGltcHJpbWlyKGludCBtYXRyaXpbNV1bM10sIGludCAqIHZldCkKewogICAgZm9yIChpbnQgaSA9IDAgOyBpPDU7IGkrKykKICAgIHsKICAgICAgICBmb3IgKGludCBqID0gMDsgajwzO2orKykKICAgICAgICB7CiAgICAgICAgICAgIHByaW50ZigiJWQiLG1hdHJpeiBbaV1bal0pOwogICAgICAgIH0KICAgICAgICBwcmludGYoIlxuIik7CiAgICB9CgogICAgZm9yIChpbnQgaSA9IDA7IGkgPCA1OyArK2kpCiAgICB7CiAgICAgICAgcHJpbnRmKCJzb21hIGxpbmhhICVkIDogJWQgXG4iLCBpICwgdmV0W2ldICk7CiAgICB9Cn0KaW50IG1haW4oKQp7CiAgICBpbnQgbWF0cml6IFs1XVszXTsKICAgIGludCB2ZXRbNV0gPSB7MH07CgogICAgY29udGEobWF0cml6LHZldCk7CiAgICBpbXByaW1pcihtYXRyaXosdmV0KTsKICAgIHJldHVybiAwOwp9Cg==