// Riempi, calcola e stampa la temperatura media della settimana #include void Inserisci (float Temp[7][4], int R, int C); float Somma(float Temp[7][4], int R, int C); int main() { float Temperature[7][4]; int I = 0, J, Righe = 7, Colonne = 4; float S = 0.0, Media = 0.0; Inserisci(Temperature, Righe, Colonne); S = Somma(Temperature, Righe, Colonne); Media = S / (Righe * Colonne); cout << "\n Media: " << Media << endl; return 0; } // fine main void Inserisci (float Temp[7][4], int R, int C) { int I = 0; while (I < R) { int J = 0; while (J < C) { cout << "\nInserisci la temperatura di posizione " << I << " " << J << " "; cin >> Temp[I][J]; J ++; } // fine while interno I ++; } // fine while esterno } // fine Inserisci() float Somma(float Temp[7][4], int R, int C) { int I = 0; float Somma = 0.0; while (I < R) { int J = 0; while (J < C) { Somma = Somma + Temp[I][J]; J++; } // fine while interno I ++; } // fine while esterno return (Somma); } // fine Somma()