習題11 3 計算最長的字串長度 15 分

2021-10-21 20:15:59 字數 650 閱讀 4126

本題要求實現乙個函式,用於計算有n個元素的指標陣列s中最長的字串的長度。

int max_len( char *s, int n );
其中n個字串儲存在s中,函式max_len應返回其中最長字串的長度。

#include #include #include #define maxn 10

#define maxs 20

int max_len( char *s, int n );

int main()

; scanf("%d", &n);

for(i = 0; i < n; i++)

printf("%d\n", max_len(string, n));

return 0;

}/* 你的**將被嵌在這裡 */

4

blue

yellow

redgreen

6
int max_len( char *s, int n )

return l;

}

習題11 3 計算最長的字串長度

本題要求實現乙個函式,用於計算有n個元素的指標陣列s中最長的字串的長度。int max len char s,int n 其中n個字串儲存在s中,函式max len應返回其中最長字串的長度。include include include define maxn 10 define maxs 20 i...

習題11 3 計算最長的字串長度 15分

本題要求實現乙個函式,用於計算有n個元素的指標陣列s中最長的字串的長度。函式介面定義 int max len char s,int n 其中n個字串儲存在s中,函式max len應返回其中最長字串的長度。裁判測試程式樣例 include include include define maxn 10 ...

(函式)計算最長的字串長度

6 2 計算最長的字串長度 10 分 本題要求實現乙個函式,用於計算有n個元素的指標陣列s中最長的字串的長度。函式介面定義 int max len char s,int n 其中n個字串儲存在s中,函式max len應返回其中最長字串的長度。裁判測試程式樣例 include include incl...