1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-12-16 15:44:39 +00:00
202401-programming-assignments/【实践课外】14.指针2/6-4 计算最长的字符串长度.c

13 lines
215 B
C

int max_len(char *s[], int n) {
int max_len = 0;
for (int i = 0; i < n; i++) {
int len = strlen(s[i]);
if (len > max_len) {
max_len = len;
}
}
return max_len;
}