#include <iostream>
#include <cstdlib>
using namespace std;

int main()
{
	double summe = 0, mittelwert = 0, eingabe = 0;
	unsigned int anzahl = 1;
	char again = 0, next = 'j';
	
	while(tolower(next)=='j'){
		do{
			cout<<anzahl<<". Zahl eingeben: "<<endl;
			cin>>eingabe;
			summe = summe + eingabe;
			mittelwert = summe / anzahl;
			cout<<"Mittelwert: "<<mittelwert<<endl;
			cout<<"Eine weitere Zahl eingeben? (J/N)";
			cin>>again;
			anzahl++;
		}
		while(tolower(again)=='j');
		
		cout<<"Eine weitere Berechnung durchführen? (J/N)";
		cin>>next;
		summe = 0;
		anzahl = 1;
		eingabe = 0;
	}
}

