函数sstrcmp()的功能是对两个字符串进行比较。当s数组中字符串和t数组中字符串相等时,返回值为0;

#include <stdio.h>
1 int sstrcmp(char s[ ],char t[])
2 { int i=0 , j=0 ;
3 while(s[i]&&t[j]&& s[i]== t[j] ) ;
4 return s[i]-t[j];
5 }
6 main()
7 { int x;
8 char s1[50],s2[50];
9 scanf("%s%s",s1,s2);
10 x= sstrcmp(s1,s2);
11 printf("\n%d\n",x);
}

第1个回答  2011-05-13
so?有什么问题?

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网