-1
include
include
using namespace Std; int main() {
srand(time(0));
int bid[3][3];
int impar = 0;
for (int x = 0; x < 3; x++)
{
for (int y = 0; y < 3; y++)
{
bid[x][y] = rand() % (386 - 0 + 1) + (-112);
}
}
for (int a = 0; a < 3; a++)
{
for (int b = 0; b < 3; b++)
{
cout << bid[a][b] << " ";
}
cout << endl;
}
// PARTE DA SOMA DAS LINHAS
int vetor[3];
for (int j = 0; j < 3; j++)
{
vetor[0] += bid[j][0];
}
for (int j = 0; j < 3; j++)
{
vetor[1] += bid[j][1];
}
for (int j = 0; j < 3; j++)
{
vetor[2] += bid[j][2];
}
for (int i = 0; i < 3; i++)
{
cout << "A soma das colunas eh: " << vetor[i];
}
system("pause");
}
The code works until the part of creating a one-dimensional matrix to receive the sum of the lines, and generates the errors C2146 and C2065, I have tried everything to compile and unsuccessfully
Excuse my ignorance, I am new in the middle and I could not understand your answer, could explain to me what would be UTF-8 and which part I would need to rewrite ?
– Thales Caruso
delete the lines where I marked Feff, and rewrite them, this will probably solve the problem
– zentrunix