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 |
Re:why wrong 指点一下In Reply To:why wrong 指点一下 Posted by:wangfengtian at 2008-12-07 19:33:53 > #include<stdio.h> > #include<math.h> > void main() > { > int a[10000],n,s,i,j; > scanf("%d",&n); > for(i=0;i<n;i++) > scanf("%d",&a[i]); > for(i=0,s=0;i<n;i++) > { > for(j=i+1;j<n;j++) > s=s+2*abs(a[i]-a[j]); > } > printf("%d\n",s); > } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator