zanuda364 2 февраля 2019 Если максимальный элемент находится во втором столбце, то увеличить все элементы третьей строки на 10.
.sS: 5 февраля 2019 #include <iostream> using namespace std; int main() { float arr[5][5]; //пример для массива 5х5 for (int i = 0; i < 5; ++i) { for (int j = 0; j < 5; ++j) { cin >> arr[i][j]; } } cout << endl; float max = arr[0][0]; int index = 0; for (int i = 0; i < 5; ++i) { for (int j = 1; j < 5; ++j) { if (arr[i][j] > max) { max = arr[i][j]; index = j; } } } if (index == 1) { for (int i = 0; i < 5; ++i) { arr[2][i] += 10; } } for (int i = 0; i < 5; ++i) { for (int j = 0; j < 5; ++j) { cout << arr[i][j] << " "; } cout << endl; } system("pause"); return 0; }
valonjo 11 февраля 2019 include <iostream> include <cstdlib> // ??? system using namespace std; int main() { int a; cin >> a; if (a%2 = 0){ cout << «Yes» << endl; } else { cout << «No» << endl; } if (a%4 = 0){ cout << «Yes» << endl; } else { cout << «No» << endl; } if (a%8 = 0){ cout << «Yes» << endl; } else { cout << «No» << endl; } return 0; } вот код помогите что здесь не так?
Если максимальный элемент находится во втором столбце, то увеличить все элементы третьей строки на 10.
include <iostream>
include <cstdlib> // ??? system
using namespace std;
int main()
{
int a;
cin >> a;
if (a%2 = 0){
cout << «Yes» << endl;
}
else {
cout << «No» << endl;
}
if (a%4 = 0){
cout << «Yes» << endl;
}
else {
cout << «No» << endl;
}
if (a%8 = 0){
cout << «Yes» << endl;
}
else {
cout << «No» << endl;
}
return 0;
}
вот код помогите что здесь не так?
Новости и уроки по ЯП: @program_easily