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 |
是我理解错了么?怎么觉得跟三角形没什么关系,但是却AC了???附代码#include<stdio.h> int t,n; int main() { scanf("%d",&t); for(int num=1;t+1-num;num++) { scanf("%d",&n);int all=0,sum=1; for(int i=1;n+1-i;i++) { sum=sum+i+1; all+=(sum*i); } printf("%d %d %d\n",num,n,all); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator