#include
#include
int main()
{
char s1[30]={0},s2[30]={0};
gets(s1);
gets(s2);
if(strcmp(s1,s2)>0)printf("s1大\n");
else if(strcmp(s1,s2)==0)printf("s1,s2一样大\n");
else if(strcmp(s1,s2)<0)printf("s2大\n");
return 0;
}
int mystrcmp(char *s1,char *s2)
{for(;*s1&&*s2&&*s1==*s2;s1++,s2++);
return *s1-*s2;
}
若s1>s2返回正值;
若s1
int fun(char *a,char *b)
{
int i=0;
while(1)
{
if(a[i]=='\0' && b[i]=='\0')
return 0;//一样长
else if(b[i]=='0')
return 1;//a长
else if(a[i]=='0')
return 2;//b长
i++;
}
}