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 |
贪心In Reply To:这样做错了,??该怎么做? Posted by:dearboy at 2005-03-20 22:56:01 > for(int i=0;i<n;i++) > scanf("%d",&array[i]); > > sort(array,array+n); > int sum=0; > for(int i=1;i<n;i++) > sum+=array[i]-array[i-1]; > printf("%d\n",sum); Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator