题目内容
下面程序的输出结果是( )。int f(char c, char *s){int m, n, h;for(n = 0, h =strlen(s); n <= h; ){m = (n+h) / 2;if(c < s[m] ) h = m-1;else if(c >s[m]) n = m + 1;else return m;}return -1;}int main(void){printf("%d“,f('g',"abdgkmxy"));printf("%d \n",f('C', "BQMAXYZOTE"));return 0;}
查看答案
搜索结果不匹配?点我反馈