1. Talent Show scoring, which can be divided into expert judges and public judges. The score [] array stores the scores of each judge. The judge_type [] stores the judges' categories corresponding to the score [] array, judge_type [I] = 1, indicating the expert judges, judge_type [I] = 2, indicating the public judges, and N indicating the total number of judges. The scoring rules are as follows: The scores of expert judges and public judges are divided into one average score (average score), and then the total score = the average score of expert judges * 0.6 + public judges * 0.4, the total score is rounded up. If no public judges are available, the total score is equal to the average score of the panel judges, and the total score is rounded up. The function returns the score of the contestant.
Int cal_score (INT score [], int judge_type [], int N) {int exsumscore = 0, pesumscore = 0; int exnum = 0, penum = 0; int res = 0; for (unsigned I = 0; I <n; I ++) {If (judge_type [I] = 1) {exsumscore + = score [I]; exnum ++ ;} else {pesumscore + = score [I]; penum ++ ;}} if (penum = 0) RES = exsumscore/exnum; else res = int (exsumscore/exnum) * 0.6 + (pesumscore/penum) * 0.4); Return res ;}