|
|
вернуться в форумWhy I've CRASH (ACCESS_VIOLATION) (C++) ? Послано sikee8 11 апр 2002 19:39 And I also have ACCESS_VIOLATION in some other problem (1184,1049). My program: #include <iostream.h> int main () { int a[100001]; a[0]=0; a[1]=1; long i = 1; while (i++<100000) { a[i] = a[i++/2]; a[i] = a[i/2] + a[i/2+1]; } for (i=2; i<=100000; i++) if (a[i-1]>a[i]) a[i]=a[i-1]; while (i) { cin >> i; if (i) cout << a[i] << "\n"; } return 0; } |
|
|