A-A+

若输入tear test arj 则下列程序的运行结果为【 】。 main() { char

2022-08-12 18:57:02 问答库 阅读 197 次

问题详情

若输入tear、test、arj,则下列程序的运行结果为【 】。 main() { char*strl[20],*str2[20],*str3[20]; char swap(); scanf("%s",str1); scanf("%s",str2); scanf("%s",str3); if (strcmp(str1,str2)>0)swap(str1,str2); if (strcmp(str1,str3)>0)swap(str1,str3); if (strcmp(str2,str3)>0)swap(str2,str3); printf("%s %s %sn",str1,str2,str3); } char swap(p1,p2) char*p1,*p2; { char*p[20]; strcpy(p,p1);strcpy(p1,p2);strcpy(p2,p); }


请帮忙给出正确答案和分析,谢谢!

参考答案

正确答案:arj tear test
arjteartest

考点:结果,程序