填空题

下列程序的运行结果是 【11】
# include<iostream. h>
# include<string. h>
void main()

char * a[5]="stuent","worker","teacher","soldier"," peasant";
char * p1, * p2;
p1=p2=a[0]
for(int i=0;i<5;i++)

if(strcmp(a[i],p1)>0)
p1=a[i];
if(strcmp(a[i],p2)<0)
p2=a[i];

cout<<p1<<","<<p2<<endl;

【参考答案】

worker,peasant