#include <iostream>
using namespace std;
const int Row = 4;
const int Col = 10;
const char Season[Row][Col] = {"Spring", "Summer", "Fall", "Winter"};
struct money {
double ex[Row];
};
void fill_array(money &, const int);
void show_array(money &, const int);
int main() {
money expenses;
fill_array(expenses, Row);
show_array(expenses, Row);
}
void fill_array(money & expenses, const int n) {
int i = 0;
while (i < n) {
cout << "Enter your " << Season[i] << "'s expenses: ";
if (!(cin >> expenses.ex[i])) {
cin.clear();
while (cin.get() != '\n')
;
cout << "Invalid value!\n";
continue;
}
i++;
}
}
void show_array(money & expenses, const int n) {
for (int i = 0; i < n; i++)
cout << Season[i] << ": " << expenses.ex[i] << endl;
}