#include "stdio.h"
main()
{static char str[80];
char *p=&str[1];
int a[20],i=0,j,b=0;
gets(p);
for(;*p!='\0';p++)
if(*p>='0'&&(*p)<='9')b=b*10+(*p)-'0';
else if(*(p-1)>='0'&&(*(p-1))<='9'){a[i++]=b;b=0;}
else continue;
if(*(p-1)>='0'&&(*(p-1))<='9')a[i++]=b;
printf("numbers:%d\n",i);
for(j=0;j<i;j++)
printf("%d ",a[j]);
printf("\n");
}
没调试工具,帮忙调试下看看可以拨
[此贴子已经被作者于2006-5-8 21:50:40编辑过]