class CArray : " />
  • <em id="6vhwh"><rt id="6vhwh"></rt></em>

    <style id="6vhwh"></style>

    <style id="6vhwh"></style>
    1. <style id="6vhwh"></style>
        <sub id="6vhwh"><p id="6vhwh"></p></sub>
        <p id="6vhwh"></p>
          1. 国产亚洲欧洲av综合一区二区三区 ,色爱综合另类图片av,亚洲av免费成人在线,久久热在线视频精品视频,成在人线av无码免费,国产精品一区二区久久毛片,亚洲精品成人片在线观看精品字幕 ,久久亚洲精品成人av秋霞

             首頁 > 專欄

            程序員面試經(jīng)典試題

            更新時間:2024-03-29 06:16:06 閱讀: 評論:0

            2024年3月29日發(fā)(作者:我愛吃番茄)

            程序員面試經(jīng)典試題

            程序員面試經(jīng)典試題

            1、現(xiàn)有1000個蘋果,10個盒子,問各個盒子內(nèi)應(yīng)該分別放入多

            少個蘋果,才能使得用戶要買任意1至1000之間的一個蘋果數(shù),都可

            以給他(賣的時候是整個盒子賣,不能拆盒子的包裝)。

            2、請仔細(xì)閱讀下面的資料:

            1)材料一:CArray

            template< class TYPE, class ARG_TYPE > class CArray : public

            CObject

            Parameters:

            TYPE

            Template parameter specifying the type of objects stored in

            the array. TYPE is a parameter that is returned by CArray.

            ARG_TYPE

            Template parameter specifying the argument type ud to

            access objects stored in the array.

            Often a reference to TYPE. ARG_TYPE is a parameter that is

            pasd to CArray.

            Remarks:

            The CArray class supports arrays that are are similar to C

            arrays, but can dynamically shrink and grow as necessary.

            Array indexes always start at position 0. You can decide

            whether to fix

            the upper bound or allow the array to expand when you add

            elements past the current bound. Memory is allocated

            contiguously to the upper bound, even if some elements are null.

            int CArray::Add (ARG_TYPE newElement);

            Return Value:

            The index of the added element.

            Parameters:

            ARG_TYPE

            Template parameter specifying the type of arguments

            referencing elements in this array.

            newElement

            The element to be added to this array.

            TYPE& CArray::operator [] (int nIndex);

            Parameters:

            TYPE

            Template parameter specifying the type of elements in this

            array.

            nIndex

            Index of the element to be accesd.

            Remarks:

            Returns the array reference of element at the specified index.

            2)材料二:CList

            templateclass CList : public CObject Parameters:

            TYPE

            Type of object stored in the list.

            ARG_TYPE

            Type ud to reference objects stored in the list. Can be a

            reference. Remarks:

            The CList class supports ordered lists of nonunique objects

            accessible quentially or by value.

            CList lists behave like doubly-linked lists.

            void CList::AddTail(ARG_TYPE newElement);

            Parameters:

            ARG_TYPE

            Template parameter specifying the type of the list element

            (can be a reference).

            newElement

            The element to be added to this list.

            Remarks:

            Adds a new element or list of elements to the tail of this list.

            The list can be empty before the operation.

            3)材料三: realloc

            realloc

            Reallocate memory blocks.

            void *realloc(void *memblock, size_t size);

            Return Value:

            The return value points to a storage space that is guaranteed

            to be suitably aligned for storage of any type of object. To get a

            pointer to a type other than void, u a type cast on the return

            value.

            Remarks:

            The size argument gives the new size of the block, in bytes.

            The contents of the block are unchanged up to the shorter of the

            new and old sizes, although the new block can be in a different

            location. Becau the new block can be in a new memory location,

            the pointer returned by realloc is not guaranteed to be the

            pointer pasd through the memblock argument.

            4)請指出下面這段代碼可能會出現(xiàn)的問題

            CList g_ValueList;

            CArray g_ValuePool;

            void AddNewValue (const V ARIANT& newValue)

            {

            g_l(&g_ValuePool[g_(newVal

            ue)]);

            }

            3、有一無符號整型數(shù)組,大小為10, 初始的數(shù)值隨機,但在[0,

            99]之間。請用C語言寫一個過濾程序,令數(shù)組內(nèi)的數(shù)據(jù)互不相等。

            說明:

            1.若數(shù)組內(nèi)有相等的數(shù)據(jù),可令某一數(shù)值加1或減1作出偏移,直

            至不等為止。

            2.數(shù)組內(nèi)的數(shù)據(jù)只能在[0, 99]之間。

            3.保持?jǐn)?shù)組內(nèi)的數(shù)據(jù)位置不變,即對應(yīng)下標(biāo)不變。

            4、按要求編寫以下函數(shù)。

            功能:將給定緩沖區(qū)中的#字符移到字符串尾部

            函數(shù)名稱:ChangeToTail

            入口參數(shù):pSZ指向緩沖區(qū)的指針, nSize緩沖區(qū)長度

            出口:pSZ所指緩沖區(qū)中的#字符被移到緩沖區(qū)尾部

            返回值:在出口緩沖區(qū)中第一個#的位置,若緩沖區(qū)中無#字符則返

            回-1 說明:如傳入#W#W#W#WW#,10 則傳出時應(yīng)轉(zhuǎn)換為

            WWWWW#####并且返回值為5

            int ChangeToTail(BYTE* pSZ, UINT nSize)

            {

            // Todo:請在此加入您的代碼

            }

            5、在金山,有一個非常經(jīng)典有趣的游戲,稱為殺人游戲。此游戲

            角色有:好人(m人)、壞人(n人)、村長(1人)、裁判(1人)。

            角色采用一定方式(如:抓鬮)分配。村長、裁判兩個角色是公開的,

            而好人、壞人兩個角色則只要裁判和本人心知肚明。其玩法如下:

            游戲開始了,裁判說:“天黑了”,這是所有其他角色都低頭閉

            上眼睛(不準(zhǔn)作弊!)。然后裁判說:“壞人開始活動”,此時壞人

            抬起頭,并相互商議,殺死一個好人。然后裁判說:“天亮了”,此

            時所有人抬頭,被殺死的那個好人宣布出局。剩下的人在村長的主持

            下,開始判斷殺人兇手。每個人可以根據(jù)各人的表情反應(yīng),判斷并提

            議殺死自己心目中的壞人。不過最終的裁決權(quán)屬于村長,綜合大家的

            意見殺死一人。此時裁判宣布此人出局。游戲進(jìn)入下一輪,由天黑到

            天亮,再有2人出局,如此反復(fù),直到最后好人先被全部殺死,則游

            戲結(jié)束,“邪惡”的一方戰(zhàn)勝了“正義”的一方;而另一個結(jié)局則是

            程序員面試經(jīng)典試題

            本文發(fā)布于:2024-03-29 06:16:05,感謝您對本站的認(rèn)可!

            本文鏈接:http://m.newhan.cn/zhishi/a/1711664166301197.html

            版權(quán)聲明:本站內(nèi)容均來自互聯(lián)網(wǎng),僅供演示用,請勿用于商業(yè)和其他非法用途。如果侵犯了您的權(quán)益請與我們聯(lián)系,我們將在24小時內(nèi)刪除。

            本文word下載地址:程序員面試經(jīng)典試題.doc

            本文 PDF 下載地址:程序員面試經(jīng)典試題.pdf

            下一篇:返回列表
            標(biāo)簽:緩沖區(qū)   好人   盒子
            留言與評論(共有 0 條評論)
               
            驗證碼:
            推薦文章
            排行榜
            Copyright ?2019-2022 Comsenz Inc.Powered by ? 實用文體寫作網(wǎng)旗下知識大全大全欄目是一個全百科類寶庫! 優(yōu)秀范文|法律文書|專利查詢|
            主站蜘蛛池模板: 国产一区韩国主播| 99久久精品国产综合婷婷| 麻豆国产传媒精品视频| 国产高潮又爽又刺激的视频| 国产特级毛片aaaaaa高清| 99精品国产综合久久久久五月天| 天天影视色香欲综合久久| 无码人妻丝袜在线视频| 国产精品免费电影| 国产在线观看免费观看| 天天爱天天做天天爽夜夜揉| 韩国一级永久免费观看网址| 国产精品va在线观看无码不卡| 粉嫩蜜臀av一区二区绯色| 久久精品国产一区二区蜜芽| 免费一区二三区三区蜜桃| 欧洲中文字幕一区二区| 日韩精品亚洲精品第一页| 国产福利高颜值在线观看| 五月婷婷深开心五月天| 久久天堂无码av网站| 小12箩利洗澡无码视频网站| 亚洲精品三区四区成人少| 国产熟女高潮一区二区三区 | 边添小泬边狠狠躁视频| 国产精品天堂avav在线| 成在线人免费视频| 亚洲精品漫画一二三区| 精品无码黑人又粗又大又长| 国产中文三级全黄| 欧美黑人性暴力猛交高清| 国产精品毛片在线看不卡| 国产精品黄大片在线播放| 亚洲一区二区精品偷拍| 国产精品毛片av999999| 亚洲国产日韩一区三区| 少妇真人直播免费视频| 午夜精品影视国产一区在线麻豆| 久久精品成人免费看| 九九热爱视频精品视频| 国产成人精品久久性色av|