为什么只循环一次
mfgok 2004-11-12 06:46:51 aoti函数
int atoz (char *p)
{
int i=1,sum=0,a;
do
{
if (*p>='0'&&*p<='9')
{
a=(*p-48)*i;
sum=sum+a;
i=i*10;p++;
}
else
exit(0);
return(sum);
} while (*p!='\0');
}
main ()
{
char a[100];
gets(a);
printf("%d",atoz(a));
getch ();
}