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 |
这样都WA,不是吧~~~#include<stdio.h> #define MAX 500 int main(){ long t[MAX]={0},w[MAX]={0},i,runs; for(i=0;i<MAX-10;i++){ t[i]=t[i-1]+i; } for(i=0;i<MAX-10;i++){ w[i]=w[i-1]+i*t[i+1]; } scanf("%ld",&runs); for(i=0;i<runs;i++){ long num; scanf("%ld",&num); printf("%ld %ld %ld\n",i+1,num,w[num]); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator