How to use PHP to implement jury raters, PHP to achieve jury rating _php tutorial

Source: Internet
Author: User

How to use PHP to implement the jury raters, PHP to achieve the jury rating


Using the Select Sort method, the first step is to find the highest and lowest points from the input array, and then remove a maximum score and a minimum score to get the average score of the contestants.

1. Implementing the Code

<?phpfunction Fairscore (& $arr) {//Select the first step in the sorting method, it is only necessary to find the maximum and minimum values in this array, it is not necessary to sort the entire array $minVal = $arr [0]; $minIndex = 0; $maxVal = $arr [0]; $maxIndex = 0; $sum = 0; for ($i =1; $i
 
  <$minval) $minval="$arr[$i];;" $minindex="$i;" }="" ($arr[$i]="">
  $maxVal)  {   $maxVal = $arr [$i];   $maxIndex = $i;  } The echo "Highest score is:" $maxVal. "The lowest score is:" $minVal. "
  
"; for ($i =0; $i The average score after the highest and lowest points is removed <?phpfairscore ($aScore);? >

2. Running

The above is the whole content of this article, I hope you can like.

http://www.bkjia.com/PHPjc/1041324.html www.bkjia.com true http://www.bkjia.com/PHPjc/1041324.html techarticle How to use PHP to implement the jury raters, PHP implementation judges scoring with the choice of sorting method The first step from the input array to find the highest and lowest points, and then remove a highest score and a minimum score ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.