|
|
back to boardthe result is correct but access violation Posted by xinxin 8 Sep 2016 19:38 #include<stdio.h> #include<string.h> int main() { int n,i=0,j=0; int a[65535]; int b[65535]={0}; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&a[i]); } i=0; while(j<65535) { j=j+i; b[j]=1; i++; } for(i=0;i<n;i++) printf("%d ",b[a[i]-1]); return 0; } can you help me? Re: the result is correct but access violation Value of Ki - a[i] in your program - is up to 2^31-1. |
|
|