求字串陣列中的最短陣列的下標

2021-08-14 07:44:44 字數 561 閱讀 1326

/*

函式fun的功能是:求ss所指字串陣列中長度最短的字串所在的行下標,作為函式值返回,並把其串長放在形參n所指的變數中。ss所指字串數陣列中共有m個字串,且串長小於n。 

請在程式的下畫線處填入正確的內容並將下畫線刪除,使程式得出正確的結果。 */

#define m 5

#define n 20

intfun(char(* ss)[n], int*n)

}return k;

} main( )

;     intn, k, i;

printf("\nthe originalb stringsare:\n");

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

puts(ss[i]);

k = fun(ss, &n);

printf("\nthe length of shortest string is: % d\n", n);

printf("\nthe shortest string is: % s\n", ss[k]);

}

shell 陣列(字串下標)

現在遊戲開的伺服器越來越多了,每次用ssh操作都要寫ip位址,很煩,也容易出錯,所以要自己搞個伺服器名到ip的對映。map anahost count 0 temp cat home linwencai sh host while read line 這種寫法裡面的count是local的 whil...

字串作為陣列下標

首先array 是從object 那裡繼承下。它具備 object 所有的功能和特性。下面是 object 的情況 新建 var object newobject 如下 var obj new object obj first my obj second name obj third is obj ...

awk陣列下標的字串化

好好努力,有乙個好的將來 日曆 var diarydays calendarbigborder calendartd calendarminput calendaryinput calendarmonthtitle calendarnow calendardaysat calendardaysun ...