GameLoft筆試題目 [Online Network Programmer Test]

來源:互聯網
上載者:User

標籤:blog   http   os   io   資料   for   ar   2014   

gameloft 筆試題目是英文的,前面全部是理論的,最後兩道是編程題目。

 

1

2

 

3

 

4

 

 

5

 

 

最後兩道編程題目 其實還算簡單:

 

#include <stdio.h>#include <string.h>#include <iostream>std::string itoa(int number){char nstr[15];sprintf(nstr,"%d",number);return std::string(nstr);}using namespace std;string compress(string text){string finalstr="";string str="";char comp=0;int ncomp=0;for(int i=0;i<text.length()  +1  /*字串結尾的\0*/;i++){//cout<<"text["<<i<<"]="<<text[i]<<endl;if(text[i]!=comp && ncomp>0){finalstr+=itoa(ncomp);finalstr+=comp;comp=text[i];ncomp=1;}else{ncomp++;if(ncomp==1)comp=text[i];}}//cout<<"finalstr="<<finalstr<<endl;return finalstr;}int OneBitCount(int nNumber){int z=0;int n=nNumber;for(int i=0;i<32;i++){if(n&0x01==1)z++;//printf("n=%d n&1 =%d z=%d\n",n,n&0x1,z);n=n>>1;}return z;}int main(){printf("Compress AAbbbCCCCCaaDDDDDD =%s",compress(string("AAbbbCCCCCaaDDDDDD")).c_str() ) ;printf("636 OneBitCount is %d\n",OneBitCount(636));return 0;}

  

前面的 大部分空著了,有的不懂什麼意思,有的 不會。

我是面試 C/C++ 後台開發的,,你給我 考 遊戲編程的 知識,,唉,不會!

 

 

我這樣透漏 gmaeloft的面試題是不是不太好? 通知我面試 也沒告訴我 是英文的,遊戲編程 概念比較多的。

我認為,C/C++一切圍繞著資料與演算法,只要基礎夠好,其他的都可以工作中學習的。這次筆試,讓我想起了 學校的考試,這還是沒資料的,沒的提前準備一下的。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.