#include<stdio.h>
intmain()
{
int a,i=0;
char s1[40],s2[40];
printf("请输入字符串s1:");
gets(s1);
printf("请输入字符串s2:");
gets(s2);
while((s1[i]==s2[i])&&(s1[i]!='\0'))
i++;
if(s1[i]=='\0'&&s2[i]=='\0')
a=0;
else
a=s1[i]-s2[i];
printf("%d\n",a);
getchar();
return 0;
} |
|