|
|
вернуться в форумPlease, tell me, why? ... :( This code gives crash on 7 test, I don't know, why... #include <iostream.h> #include <stdio.h> #include <math.h> int i; void main() { double M[8000]; double t; int n=0; while ( cin >> t ) { M[n] = sqrt( t ); n++; } for( int i=n-1; i>=0; i--) { printf("%.4f\n", M[i] ) ; } } Can you give any idea, why is it so? Re: Please, tell me, why? ... :( 8000 don't enough.Put attention there:Размер входного потока не превышает 256 КБ. If you write double *M=new double[8000000](i.e.creating dynamic array) instead of double M[8000] I'm think you will get AC.Good luck! Edited by author 12.08.2007 03:29 |
|
|