題目: 我模拟的代码: class Solution { public: int numberOfMatches(int n) { int num=0; while(n!=1) { num+=n/2; n=(n+1)/2; } return num; } }; 零神说,直接返回n-1就行了。因为每一场比赛淘汰一组,一共淘汰了n-1组。因此一共有n-1场比赛。 智商再次被碾压。