#include #include #include int main(void) { ifstream fi("luku.dat"); if ( !fi ) return 1; //ak tj double i,j = 0; //ak tj double summa = 0; //ak tj double k_a; //ak tj while ( fi ) { //ak tj if ( !(fi >> i) ) break; //ak tj summa = summa + i; //ak tj j++; //ak tj } fi.close(); if ( j != 0 ) // vl k_a = summa/j; //ak tj cout << setprecision(3) << setiosflags(ios::showpoint|ios::fixed) // << d(5,3) << k_a << endl; //ak tj // printf("5.3%lf\n",k_a); return 0; // printf("%p",p); // cPiste p; cout << p; // Teht 11: cout << "(" << x << "," << y << ")" << endl; }