这段c语言是什么意思
#include<stdio.h>3include<string>
void main() {
int i;
char* a[5]={"student","worker","cader","soldier","peasant"};
char *p1, *p2;
p1=p2=a[0];
for(i=0;i<5;i++) {
if(strcmp(a[i], p1)>0) p1=a[i];
if(strcmp(a[i], p2)<0) p2=a[i];
}
printf("5s %s\n",p1,p2);
}
我知道答案是Worker cader
我就想知道它的详细的解题步骤和思路