markdown 在线制作ppt json校验和格式化工具

POJ 1455

 1 /*
 2 冒泡排序n*(n-1)/2;
 3 */
 4 
 5 #include <iostream>
 6 using namespace std;
 7 
 8 int main()
 9 {
10     //freopen("acm.acm","r",stdin);
11     int test;
12     int n;
13     cin>>test;
14     while(test --)
15     {
16         cin>>n;
17         if(n%2 == 0)
18         {
19             cout<<(n/2-1)*(n/2)<<endl;
20         }
21         else
22         {
23             cout<<(n/2-1)*(n/2)/2 + (n-n/2-1)*(n-n/2)/2<<endl;
24         }
25     }
26 }

 

关注我的公众号,当然,如果你对Java, Scala, Python等技术经验,以及编程日记,感兴趣的话。 

技术网站地址: vmfor.com

posted @ 2015-06-09 14:02  GavinHacker  阅读(165)  评论(0编辑  收藏  举报
markdown 在线制作ppt json校验和格式化工具