brauche dringend hilfe!! wie kann ich die schleife in diesem Programm durch die eingabe einer Variable abrechen!?
Code:#include <cstdlib> #include <iostream> using namespace std; int main(int argc, char *argv[]) { double werte[10]; int loop; int zahl = 99999; for(loop = 0; loop < zahl; ++loop) { cout << " Geben Sie einen Wert ein: "; cin >> werte[loop]; } double mittelwert = 0; for(loop = 0; loop < zahl; ++loop) { mittelwert += werte[loop]; } cout << "Mittelwert: " << mittelwert/10.0 << endl; system("PAUSE"); return EXIT_SUCCESS; }



Zitieren