# include & ltstring.h & gt
void main()
{ char str 1[]= { ' 0 ' };str 2[]= { ' 0 ' };gets(str 1);gets(str 2);//如果是給定的字符串,也就是字符串已經提前初始化,這裏可以省略。)
if(strcmp(str1,str2)>0)
{printf("最大字符串為:");
puts(str 1);}
其他
{printf("最大字符串為:");
看跌期權(str 2);}
if(strlen(str1)>strlen(str2))
{printf("最長的字符串是:");
puts(str 1);}
其他
{printf("最長的字符串是:");
看跌期權(str 2);}
}