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 zhucheng at 2005-03-21 13:02:28 on Problem 2313
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:
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