srand(time(0));
const int columns = 5;
const int lines = 5;
int polozh = 0;
int otric = 0;
int A[lines][columns]{};
cout << "Massive A:" << endl;
for (int i = 0; i < lines; i++) {
}
cout << endl << "+: " << polozh << endl
<< "-: " << otric << endl;
system("pause");
const int columns = 5;
const int lines = 5;
int polozh = 0;
int otric = 0;
int A[lines][columns]{};
cout << "Massive A:" << endl;
for (int i = 0; i < lines; i++) {
for (int j = 0; j < columns; j++) {
A[i][j] = rand() % 11 - 5;
cout.width(4);
cout << A[i][j];
if (A[i][j]>0)
polozh++;if (A[i][j] < 0)
otric++;
}
cout << endl;
}
cout << endl << "+: " << polozh << endl
<< "-: " << otric << endl;
system("pause");
Комментариев нет:
Отправить комментарий