满意答案
Letheann
2013.07.19
采纳率:41% 等级:13
已帮助:10480人
#include #include "windows.h"#define MAX 1024main(){ char *str1,*str2,*p; int i=0,k=0; str1=(char *)malloc(1024*sizeof(char)); str2=(char *)malloc(1024*sizeof(char)); fflush(stdin); gets(str1); fflush(stdin); gets(str2); p=str1; while(*p!='\0') { if(isdigit(*p)) i=i*10+*p-'0'; p++; } p=str2; while(*p!='\0') { if(isdigit(*p)) k=k*10+*p-'0'; p++; } printf("%d\n",i+k); free(str1); free(str2);}
00分享举报