题目内容
The function scmp in the following program returns the first address of the smaller string in the strings pointed by formal parameter pointers s1 and s2. #includechar *scmp (char *s1,char *s2) { if (strcmp(s1,s2)< 0) return(s1); else return (s2); } main() { int i;char string[20],str[3][20]; for (i=0;i <3;i++) gets (str[i]); strcpy(string,scmp(str[0],str[1])); /* strcpy library function copies strings */ strcpy(string,scmp (string,str[2])); printf("%s\n",string); } If inputs three strings in turn: abcd, abba, and abc, the output is ( )
查看答案
搜索结果不匹配?点我反馈
更多问题