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> void main() { __int64 m, n; __int64 t; while(scanf("%I64d",&m),m) { if(m==2) { printf("1\n"); continue; } if(m==3) { printf("3\n"); continue; } if(m==4) { printf("5\n"); continue; } if(m>4) { if(m%2==1) { n=m/2; t=2*(n+1)*n-2*n+1; printf("%I64d\n",t); continue; } else { n=m/2-1; t=2*(n+1)*n+1; printf("%I64d\n",t); } } } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator