strcmp(str1,str2):
str1>str2时strcmp()>0,
str1=str2时strcmp()=0,
str1<str2时strcmp()<0
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
char str[80], max[80]
int i
scanf("%s", &max)
for(k=1k<=4k++)
{
scanf("%s", &str)
if(strcmp(max,str)<0)
strcpy(max,str)
}
printf("Max is: %s\n", max)
}
简单的很的程序!
希望能解决您的问题。
讠工白 zha 打出如下:1、
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)