错在哪:程序产生一个访问违例(段异常)
#include <stdio.h>
#include <string.h>main()
{
char a[4000000];
long n1,n2,n,i;
while (gets(a))
{
n1=n2=0;
for (i=0;i<=strlen(a)-1;i+=2)
n1+=(a[i]-'0');
for (i=1;i<=strlen(a)-1;i+=2)
n2+=(a[i]-'0');
n=n1-n2;
if (n%11==0) puts(\"YES\");
else puts(\"NO\");
}
return 0;
}