#include#includevoidmain(){ char*a[5]={"student","worker","cadre","soldier","peasant"};char *p1,*p2; p1=p2=a[0]; for(int i=0;i0) p1=a[i]; if(strcmp(a[i],p2)

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/19 04:09:13
#include#includevoidmain(){char*a[5]={"student","worker","cadre","soldier","peasant"};char*p1,*p2;p1

#include#includevoidmain(){ char*a[5]={"student","worker","cadre","soldier","peasant"};char *p1,*p2; p1=p2=a[0]; for(int i=0;i0) p1=a[i]; if(strcmp(a[i],p2)
#include
#include
voidmain()
{
char
*a[5]={"student","worker","cadre","soldier","peasant"};
char *p1,*p2;
p1=p2=a[0];
for(int i=0;i0)
p1=a[i];
if(strcmp(a[i],p2)

#include#includevoidmain(){ char*a[5]={"student","worker","cadre","soldier","peasant"};char *p1,*p2; p1=p2=a[0]; for(int i=0;i0) p1=a[i]; if(strcmp(a[i],p2)
#include
#include
void main()
{
char
*a[5]={"student","worker","cadre","soldier","peasant"}; /* 定义5个字符串 */
char *p1,*p2; /* 定义2个字符指针 */
p1=p2=a[0]; /* 初始化p1,p2均为第1个字符串 */
for(int i=0;i0) /* 如果字符串a[i]大于p1 */
p1=a[i]; /* 将较大的字符串a[i]给p1 */
if(strcmp(a[i],p2)