ier","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("%s %s\n",p1,p2);Р}Р输出结果为:Рworker cadreРPress any key to continueР Р3. #include<stdio.h>Рint a[10]={4,5,6,15,20,13,12,7,8,9};Рvoid main()Р{Р int i,s0,s1,s2;Р s0=s1=s2=0;Р for(i=0;i<10;i++){Р switch(a[i]%3){Р case 0:s0+=a[i];break;Р case 1:s1+=a[i];break;Р case 2:s2+=a[i];break;Р }Р }Р printf("%d %d %d\n",s0,s1,s2);Р Р}Р输出结果为:Р42 24 33РPress any key to continueР4. #include<stdio.h>Рvoid main()Р{Р char a[]="abcdbfbgacd";Р int i1=0,i2=0,i=0;Р while(a[i]){Р if(a[i]=='a')i1++;