#include <iostream>
using namespace std;
int main()
{
#define B_LENGTH 10
// Variables
int b[B_LENGTH] = { 0 };
int bSum = 0;
// Input data
cout << "Input " << B_LENGTH << " numbers in your array." << endl;
cout << "Important condition, your number can be more then 1, but less then 7" << endl;
for (int i = 0; i < B_LENGTH; i++) {
while (b[i] <= 1 || b[i] >= 7) {
cout << "B[" << i << "] = ";
cin >> b[i];
}
}
// Output data
cout << "Good. Your array is:" << endl;
for (int i = 0; i < B_LENGTH; i++) {
bSum += b[i];
cout << b[i] << " ";
}
cout << endl << "Sum of the array elements is " << bSum << endl;
return 0;
}
#include <iostream>
using namespace std;
int main() {
setlocale(LC_ALL, "Rus");
int n;
cout << "Введите номер месяца:";
cin >> n;
if (n == 12 || n == 1 || n == 2) {
cout << "Зима";
}
else if (n >= 3 && n <= 5) {
cout << "Весна";
}
else if (n >= 6 && n <= 8) {
cout << "Лето";
}
else if (n >= 9 && n <= 11) {
cout << "Осень";
}
else {
cout << "Введён неверный номер месяца";
}
return 0;
}
1) Результат выполнения программы: od Moo
ответ: 5
2) Результат выполнения программы: yek
ответ: yek
P.S. Программа во-втором задании некорректно работает. Имеются ошибки