#include <stdio.h>
#define N 100
int main(int argc, int *argvp[])
{
char str1[N],str2[N];
char c1,c2;
int i,result = 0;
printf("please input s1 string:");
gets(str1);
printf("please input s2 string:");
gets(str2);
for (i = 0 ; ((c1 = str1[i]) != '\0') && ((c2 = str2[i]) != '\0') ; i++)
{
result = c1 - c2;
if (0 == result)
{
continue;
}
else
{
break;
}
}
printf("the result is :%d\n",result);
system("pause");
return 0;
}
|