Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
参考样例#include <stdio.h> #include <stdlib.h> int main() { int n,s; int pre,sufix; scanf("%d",&n); while(n--) { scanf("%d",&s); pre=(s>>1); sufix=s-pre; printf("%d\n",(pre*(pre-1)+sufix*(sufix-1))/2); } system("pause"); } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator