#include "iostream"
using namespace std;
int main()
{
int players;
while (cin >> players && players)
{
int count = 0, a, b;
while (players)
{
if (players == 1)
{
cout << count << endl;
break;
}
if (players == 2)
{
cout << count + 1 << endl;
break;
}
a = players / 3;
b = players % 3;
players = a + b;//剩下的人数
count = count + a;//需要比赛的场数
}
}
}
zoj 2830 Champion of the Swordsmanship
最新推荐文章于 2015-10-26 20:38:39 发布