#include <iostream>
using namespace :: std ; // con questo possiamo usare cout direttamente invece di std::cout
int main( ) // Loop principale
{
// float == valore con la virgola
float temperatura, valore;
int i; // i == index
for ( i = 0 ; i < 7 ; i++ ) { // loop da 1 a 7
cout << "Inserisci la temperatura settimanale " << i+ 1 << ": " ;
cin >> valore; // Prendi il valore di input e mettilo all'interno di valore
temperatura = temperatura + valore; // sommatoria
}
temperatura = temperatura / 7 ; // media
cout << "La temperatura media è: " << temperatura<< "°C" ;
return 0 ; // Esci con valore 0, significando che il programma è andato con successo
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdXNpbmcgbmFtZXNwYWNlOjpzdGQ7IC8vIGNvbiBxdWVzdG8gcG9zc2lhbW8gdXNhcmUgY291dCBkaXJldHRhbWVudGUgaW52ZWNlIGRpIHN0ZDo6Y291dAoKaW50IG1haW4oKSAvLyBMb29wIHByaW5jaXBhbGUKewogICAgLy8gZmxvYXQgPT0gdmFsb3JlIGNvbiBsYSB2aXJnb2xhCglmbG9hdCB0ZW1wZXJhdHVyYSwgdmFsb3JlOwoJaW50IGk7IC8vIGkgPT0gaW5kZXgKCglmb3IgKGkgPSAwOyBpIDwgNzsgaSsrKXsgLy8gbG9vcCBkYSAxIGEgNwoJICAgIGNvdXQgPDwgIkluc2VyaXNjaSBsYSB0ZW1wZXJhdHVyYSBzZXR0aW1hbmFsZSAiPDxpKzE8PCI6ICI7CgkJY2luID4+IHZhbG9yZTsgLy8gUHJlbmRpICBpbCB2YWxvcmUgZGkgaW5wdXQgZSBtZXR0aWxvIGFsbCdpbnRlcm5vIGRpIHZhbG9yZQoJCXRlbXBlcmF0dXJhID0gdGVtcGVyYXR1cmEgKyB2YWxvcmU7IC8vIHNvbW1hdG9yaWEKCX0KCgl0ZW1wZXJhdHVyYSA9IHRlbXBlcmF0dXJhIC8gNzsgLy8gbWVkaWEKCWNvdXQgPDwgIkxhIHRlbXBlcmF0dXJhIG1lZGlhIMOoOiAiPDx0ZW1wZXJhdHVyYTw8IsKwQyI7CgkKCXJldHVybiAwOyAvLyBFc2NpIGNvbiB2YWxvcmUgMCwgc2lnbmlmaWNhbmRvIGNoZSBpbCBwcm9ncmFtbWEgw6ggYW5kYXRvIGNvbiBzdWNjZXNzbwp9Cg==