runtime error (SIGSEGV)
Posted
by vamsi2018
on Stack Overflow
See other posts from Stack Overflow
or by vamsi2018
Published on 2010-04-22T10:02:30Z
Indexed on
2010/04/22
10:03 UTC
Read the original article
Hit count: 401
hi, i would be happy to know why i got this error for the problem http://www.codechef.com/problems/AXR1P2 in codechef.com and my code is...
include
include
int main() { int *num=0,n=0,i=0,max=0;char *s=""; int sum[9]={1,5,14,20,25,31,32,38,39},dsum[9]={1,7,8,14,19,25,26,32,33},unitdig=0; do { gets(s); *(num+i)=(int)atoi(s); i++; }while(s!='#'); max=i; for(i=0;i10) unitdig=33(n/10-1)+39+dsum[(n%10)-1]; else unitdig=sum[(n%10)-1]; printf("%d\n",unitdig%10); } getchar(); return 0;}
© Stack Overflow or respective owner