输出量字符串的差值;(例:'and'和'aid'输出5,A和c,输出-2)为什么我写的有的对,有的不正确呢
#include<stdio.h>#include<stdlib.h>
int main(){
char s1[100],s2[100];
int i,n;
scanf("%s%s",&s1,&s2);
for(i=0;s1[i]!='\0'&&s2[i]!='\0';i++){
if(s1[i]!=s2[i])
n=s1[i]-s2[i];
goto label_1;
}
{ if(s1[i]='\0'&&s2[i]!=0) n=s2[i];
if(s2[i]='\0'&&s1[i]!=0) n=s1[i];
else
n=0;
}
label_1:
printf("%d",n);
system("pause");
return 0;
}