0 / 0 / 0
Регистрация: 15.02.2017
Сообщений: 19
|
|
1 | |
'arr' was not declared in this scope 'sum' was not declared in this scope такие вот ошибки.(01.03.2017, 18:31. Показов 5875. Ответов 2
#include <iostream>
#include <cstdlib> #include <ctime> using namespace std; int main () { setlocale(LC_ALL, "rus"); srand((unsigned)time(NULL)); const int n=5; double MaxMDiag=DBL_MIN, arr[n][n], sum=0; cout << "Массив" << endl; for (int i=0; i<n; i++) { for (int j=0; j<n; j++) { arr[i][j] = (rand()%71-20)*0,12; if (i==j && arr[i][j]>MaxMDiag) MaxMDiag = arr[i][j]; cout << arr[i][j] << '\t'; } cout << endl; } cout << "Новый массив" << endl; for (int i=0; i<n; i++) { for (int j=0; j<n; j++) { if (arr[i][j]>MaxMDiag) sum += arr[i][j]; if (i==j) swap(arr[i][i], arr[i][n-i-1]); cout<< arr[i][j] << '\t'; } cout << endl; } if (sum == 0) cout << "В массиве нету элементов больших максимума главной диагонали!" << endl; else cout << "Сумма элементов массива, которые больше максимума главной диагонали: " << sum << endl; system("pause"); return 0; }
__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь
0
|
|
01.03.2017, 18:31 | |
Ответы с готовыми решениями:
2
Список с дробями: Variable or field 'input' declared void 'pd' was not declared in this scope Вот такая проблема 'clrscr' was not declared in this scope Ошибки:х1,х2 was not declared in this scope
|
![]() |
||||||
01.03.2017, 18:37 | 2 | |||||
![]() Решение
1
|
0 / 0 / 0
Регистрация: 15.02.2017
Сообщений: 19
|
|
01.03.2017, 19:17 [ТС] | 3 |
Спасибо большое
0
|
01.03.2017, 19:17 | |
Помогаю со студенческими работами здесь
3
Найти причины и способы исправления ошибки 'clrscr' was not declared in this scope (Dev C++) Was not declared in this scope 'mean' was not declared in this scope Was not declared in this scope Искать еще темы с ответами Или воспользуйтесь поиском по форуму: |