Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

是我理解错了么?怎么觉得跟三角形没什么关系,但是却AC了???附代码

Posted by speedcell4 at 2011-02-09 17:17:18 on Problem 3086
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator