|
|
вернуться в форумi have submitted this five times always i get crash(access violation) error #include<stdio.h> #include<math.h> double a[90]; int main(void) { double ch; long int j=0; while(scanf("%lf",&ch)!=EOF && j<=90) a[j++]=sqrt(ch); for(j-=1;j>=0;--j) printf("%.4lf\n",a[j]); return 0; } Edited by author 16.07.2007 20:18 Edited by author 16.07.2007 20:18 Edited by author 16.07.2007 20:18 Re: what is wrong in this code . 1. You haven't allocate memory for array a like this: float a[N]; 2. You don't need to do this: if(ch == ' ') continue; scanf() will automaticaly read only numbers. Good luck |
|
|