華為招聘機試整理6:選秀節目打分,華為選秀

來源:互聯網
上載者:User

華為招聘機試整理6:選秀節目打分,華為選秀
華為招聘機試整理6:選秀節目打分

題目:選秀節目打分
題目描述:為專家評委和福士評委,score[] 數組裡面儲存每個評委打的分數,judge_type[] 裡儲存與 score[] 數組對應的評委類別,judge_type[i] == 1,表示專家評委,judge_type[i] == 2,表示福士評委,n表示評委總數。打分規則如下:專家評委和福士評委的分數先分別取一個平均分(平均分取整),然後,總分 = 專家評委平均分乘以0.6 + 福士評委乘以0.4,總分取整。如果沒有福士評委,則 總分 = 專家評委平均分,總分取整。函數最終返回選手得分。
函數介面:int cal_score(int score[], int judge_type[], int n)
題目分析:
這道題比較簡單,就是需要假設一些變數。

===========================================================================
參考代碼:

//選秀節目打分.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;}

調試中易犯錯誤,int sum = 0最後不能忘記逗號。


昨天華為校園招聘機試,懂的人都知道做對兩道已經很不容易了,昨天問工作人員他們也說做對兩道非常優秀

不要著急,因為人多嘛,總得給人家時間對吧,華為面試還是很公平公正的,找關係走後門的基本沒有,既然你初試成績不錯那應該會有複試機會的,不過也有可能別人工作失誤遺漏之類的,所以你過兩天可以想辦法找學校就業指導中心要HR的連絡方式,相信會有效果的,我也想進華為
 
華為2013校園招聘,機試完了,什時面試,是不是被刷了

建議去對應大街網啊,應屆生網看看。他們有詳細的進程的。
另外,你也可以直接去新浪微博去@對應的招聘人員,裡面有華為的每個地區的招聘微博的。
祝你好運。
 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.