Auto commit
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int main(){
|
||||
char str[5][20];
|
||||
char (*p)[20], (*max)[20];//数据类型 (*变量名)[长度];数组指针
|
||||
int i;
|
||||
for(i=0, p =str;i<5;i++){
|
||||
scanf("%s", p++);
|
||||
}
|
||||
max = p;
|
||||
|
||||
for(i=1, p =str+1;i<5;i++){
|
||||
if(strcmp(*p, *max)){
|
||||
max = p;
|
||||
}
|
||||
p++;
|
||||
}
|
||||
printf("max = %s\n", max);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user