您的位置:首页 > 其它

zoj1730

2015-07-25 20:54 337 查看
简单题

#include <iostream>

using namespace std;

//第一次碰到冒泡法
int main()
{
int t,n,time;
cin >> t;
while(t--)
{
cin >> n;
if(n%2==0)
time=2*(n/2)*(n/2-1)/2;
else
time=(n/2)*(n/2 -1)/2 + (n/2 +1)*(n/2)/2 ;
cout << time << endl;
}
return 0;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: