#include <stdio.h>#include <string.h>#include <stdlib.h>int main(){ char str1[50],str2[50]; int i,s; printf("Please input string 1:\n"); gets(str1); printf("Please input string 2:\n"); gets(str2); i=0; while((str1[i]==str2[i])&&(str1[i]!='\0')&&(str2[i]!='\0')) i++; if(str1[i]=='\0'||str2[i]=='\0') printf("error!"); else{ s=abs(str1[i]-str2[i]); printf("%d\n",s); return 0; }}
