#include using namespace std; const int NUMERO_MESI = 12; void leggiTemperature(float temperature[NUMERO_MESI]); void stampaTemperature(float temperature[NUMERO_MESI]); int main() { float temperature[NUMERO_MESI]; leggiTemperature(temperature); stampaTemperature(temperature); return 0; } void leggiTemperature(float temperature[NUMERO_MESI]) { cout << "inserisci i valori di temperatura dei vari mesi: " << endl; for (int i = 0; i < NUMERO_MESI; i++) { float valoreTmp; cout << "mese " << i+1 << " = "; cin >> valoreTmp; while ((valoreTmp < -20) || (valoreTmp > 60)) { cout << "Errore, temperatura non corretta, reinseriscila: "; cin >> valoreTmp; } temperature[i] = valoreTmp; } } void stampaTemperature(float temperature[NUMERO_MESI]) { cout << endl << "riepilogo dei valori inseriti:" << endl; for (int i = 0; i < NUMERO_MESI; i++) { cout << "mese " << i+1 << " = " << temperature[i] << endl; } }