fork download
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. rechnen(int* pntr,int anzahl){
  5. int temp;
  6.  
  7. for(;anzahl>0;anzahl--)
  8. temp+=pntr[anzahl-1];
  9.  
  10. delete[] pntr;
  11. return temp/anzahl;
  12. }
  13.  
  14.  
  15. int main(int argc,char* argv[]){
  16. int anzahl;
  17. cout<<"Wie viele Werte wollen sie eingeben?"<<endl;
  18. cin>>anzahl;
  19.  
  20. int*pntr= new int [anzahl];
  21. int i;
  22.  
  23. for(i=0;i<anzahl;i++){
  24. cout<<"Bitte gib den "<<i+1<<" Wert ein:";
  25. cin>>pntr[i];
  26. system("cls");
  27. }
  28. cout<<"Der Durchschnitt ihrer "<<anzahl<<" Werte ist:"<<rechnen(pntr,anzahl);
  29. return 0;
  30. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:4:29: error: ISO C++ forbids declaration of ‘rechnen’ with no type [-fpermissive]
 rechnen(int* pntr,int anzahl){
                             ^
stdout
Standard output is empty