呼叫下列C函式時若傳入字串"To be or not to be, that's the question",則回傳值為何? int fn(char *s) { int num=0; while (*s) if (*s++ ==' ') num++; return num; }
A5
B6
C7
D8正確答案
答案與詳解
字串 'To be or not to be, that's the question' 有 8 個空格:To|be|or|not|to|be,|that's|the|question,單字間共 8 個空白。
Examly 收錄 38 萬+ 道歷屆題目,每題都有像這樣的精選詳解。免費下載,立即開練。
