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

这程序到底哪里错了?为什么总通不过呢?

Posted by zeng at 2008-02-20 14:12:08 on Problem 3086
#include <stdio.h>

int main()
{
  int N, n, w=0, T[301], i, j;
  scanf("%d", &N);
  for(i=0; i<=300; i++)
	  T[i]=0;
  for(i=1; i<=300; i++)
	  T[i]=i+T[i-1];
  for(i=1; i<=N; i++)
  {
    scanf("%d", &n);
	for(j=1;j<=n;j++)
		w+=j*T[j+1];
	printf("%d %d %d", i, n, w);
	w=0;
   }

return 0;

}

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