Huawei recruitment machine trial 6: Draft Program scoring, Huawei draft

Source: Internet
Author: User

Huawei recruitment machine trial 6: Draft Program scoring, Huawei draft
Huawei recruitment machine trial 6: Draft Program scoring

Title: Draft Program score
Title: expert judges and public judges. The score [] array stores the scores of each judge. The judge_type [] stores the types of judges 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 multiplied by 0.6 + the average score of public judges multiplied by 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.
Function interface: int cal_score (int score [], int judge_type [], int n)
Question Analysis:
This question is relatively simple, that is, we need to assume some variables.

========================================================== ==========================================
Reference code:

// Score the draft program. cpp // 2014.7.10 hepanhui # include <iostream> # include <string> const int maxn = 100; using namespace std; int cal_score (int score [], int judge_type [], int n) {int expert_score = 0; int public_score = 0; int expert_number = 0; int public_number = 0; int sum = 0; for (int I = 0; I <n; I ++) {if (judge_type [I] = 1) {expert_score + = score [I]; expert_number ++;} else {public_score + = score [I]; public_number ++ ;}}if (public_number) {expert_score = expert_score/expert_number; public_score = public_score/public_number; sum = (int) expert_score * 0.6 + public_score * 0.4 ;} else sum = expert_score/expert_number; return sum;} int main () {int n; cin> n; int score [maxn]; int judge_type [maxn]; for (int I = 0; I <n; I ++) {cin> score [I];} for (int j = 0; j <n; j ++) {cin> judge_type [j];} cout <cal_score (score, judge_type, n) <endl; return 0 ;}

Mistakes are easy to make during debugging. int sum = 0 cannot forget the comma.


Yesterday, Huawei recruited an opportunity for testing on campus. People familiar with this knowledge knew that it was not easy to do the right thing. Yesterday, they asked the staff that they were doing the right thing.

Don't worry, because there are too many people, you have to give them time, right? Huawei's interview is still fair and fair, and there are basically no backdoors for finding relationships, now that you have a good first test score, you should have a chance to review it. However, there may also be mistakes made by others, so you can find a way to contact the school employment guidance center for HR in two days. I believe it will work and I want to enter Huawei
 
Huawei 2013 campus recruitment, machine trial is complete, when the interview, is it brushed?

We recommend that you go to the corresponding street network and check the fresh graduates network. They have detailed processes.
In addition, you can also go to Sina Weibo directly to @ corresponding recruiters, which include Weibo recruitment for each region of Huawei.
Good luck.

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.