#include #define N 50 #include int WeDa(double*); void zeruj (int, double, int, int); int main () { double x[N]; int n,d,g; n=WeDa(&x[0]); if(n==-1) { printf("blad otwarcia pliku"); return n; } if(n==-2) { printf("ujemna ilosc danych"); return n; } if(n==-3) { printf("zbyt duza ilosc danych"); return n; } printf ("podaj indeks dolny: "); scanf ("%d",&d); printf ("podaj indeks gorny: "); scanf ("%d",&g); return 0; } int WeDa(double*x) { FILE *dane, *wy; int ilosc, i; dane=fopen("dane.txt", "r"); if (dane==NULL) return -1; fscanf(dane, "%d", &ilosc); if (ilosc<=0) return -2; if (ilosc>N) return -3; for (i=0; i