#include
#include
#define M 10
/*238-5.编写比较字符串的函数(重现strcmp函数)*/
/* run this program using the console pauser or add your own getch, system("pause") or input loop /
int Strcompare(char *s1,char *s2)
{
char *ss1,*ss2;
ss1=s1;
ss2=s2;
while((ss1++)==*(ss2++)&&*(ss1++)!='0'&&*(ss2++)!='0')
{
}
return *s1-*s2 ;
}
int main(int argc, char *argv[])
{
char *s1,*s2,str1[M],str2[M];
int i=0,j=0;
int a;
while(((str1[i++]=getchar())!='\n')&&((str2[j++]=getchar())!='\n'));
s1=str1;
s2=str2;
a=Strcompare(s1,s2);
printf("%d",a);
return 0;
}