#include <stdio.h>
#include <string.h>
int howmuchsize(char *ps1,char *ps2)
{
int t=0;
unsigned i,j;
for(i=0;i<strlen(ps1);i++ )
{
for(j=0;j<strlen(ps2);j++){
if(*(ps1+i)==*(ps2+j)){
t++;
break;
}
else
continue;
}
}
return strlen(ps1)-t;
}
int main()
{
char s[100],r[100];
char *ps1=s;
char *ps2=r;
printf("输入字符串1:\n");
gets(s);
printf("输入字符串2:\n");
gets(r);
printf("%d\n",howmuchsize(ps1,ps2));
return 0;
}
[
本帖最后由 kami_dante 于 2011-4-24 20:49 编辑 ]