<dfn id="w48us"></dfn><ul id="w48us"></ul>
  • <ul id="w48us"></ul>
  • <del id="w48us"></del>
    <ul id="w48us"></ul>
  • 華為c語言筆試

    C語言是一門面向過程的、抽象化的通用程序設(shè)計語言,廣泛應(yīng)用于底層開發(fā)。C語言能以簡易的方式編譯、處理低級存儲器。C語言是僅產(chǎn)生少量的機器語言以及不需要任何運行環(huán)境支持便能運行的高效率程序設(shè)計語言。盡管C語言提供了許多低級處理的功能,但仍然保持著跨平臺的特性,以一個標準規(guī)格寫出的C語言程序可在包括類似嵌入式處理器以及超級計算機等作業(yè)平臺的許多計算機平臺上進行編譯。

    華為C語言筆試題

    標簽:筆試題目 時間:2021-04-30
    【yjbys.com - 筆試題目】

      一、判斷題(對的.寫t,錯的寫f并說明原因,每小題4分,共20分)

      1、有數(shù)組定義int a[2][2]={{1},{2,3}};則a[0][1]的值為0。( )

      2、int (*ptr) (),則ptr是一維數(shù)組的名字。( )

      3、指針在任何情況下都可進行>, <, >=, <=, = =運算。( )

      4、switch(c) 語句中c可以是int, long, char, float, unsigned int 類型。( )

      5、#define print(x) printf("the no, "#x",is ")

      二、填空題(共30分)

      1、在windows下,寫出運行結(jié)果,每空2分,共10分。

      char str[ ]= "hello";

      char *p=str;

      int n=10;

      sizeof(str)=( )

      sizeof(p)=( )

      sizeof(n)=( )

      void func(char str[100])

      { }

      sizeof(str)=( )

      2、void setmemory(char **p, int num)

      { *p=(char *) malloc(num);}

      void test(void)

      { char *str=null;

      getmemory(str,100);

    華為筆試題(C語言)

    標簽:筆試題目 時間:2021-04-25
    【yjbys.com - 筆試題目】

    一、判斷題(對的`寫T,錯的寫F并說明原因,每小題4分,共20分)

    1、有數(shù)組定義int a[2][2]={{1},{2,3}};則a[0][1]的值為0。( )

    2、int (*ptr) (),則ptr是一維數(shù)組的名字。( )

    3、指針在任何情況下都可進行>, <, >=, <=, = =運算。( )

    4、switch(c) 語句中c可以是int, long, char, float, unsigned int 類型。( )

    5、#define print(x) printf("the no, "#x",is ")

    二、填空題(共30分)

    1、在windows下,寫出運行結(jié)果,每空2分,共10分。

    char str[ ]= "Hello";

    char *p=str;

    int n=10;

    sizeof(str)=( )

    sizeof(p)=( )

    sizeof(n)=( )

    void func(char str[100])

    { }

    sizeof(str)=( )

    2、void setmemory(char **p, int num)

    { *p=(char *) malloc(num);}

    void test(void)

    { char *str=NULL;

    getmemory(&str,100);

    strcpy(str,"hello");

    printf(str);

    }

    運行test函數(shù)有什么結(jié)果?( )10分

    華為C語言筆試題目分享

    標簽:綜合指導(dǎo) 時間:2021-03-18
    【yjbys.com - 綜合指導(dǎo)】

      華為C語言筆試題目分享:

      一、判斷

      1、有數(shù)組定義inta[2][2]={{1},{2,3}};則a[0][1]的值為0。()

      2、int(*ptr)(),則ptr是一維數(shù)組的名字。()

      3、指針在任何情況下都可進行>,<,>=,<=,==運算。()< p="">

      4、switch(c)語句中c可以是int,long,char,float,unsignedint類型。()

      5、#defineprint(x)printf("theno,"#x",is")

      二、填空

      1、在windows下,寫出運行結(jié)果,每空2分,共10分。

      charstr[]="Hello";

      char*p=str;

      intn=10;

      sizeof(str)=()

      sizeof(p)=()

      sizeof(n)=()

      voidfunc(charstr[100])

      {}

      sizeof(str)=()

      2、voidsetmemory(char**p,intnum)

      {*p=(char*)malloc(num);}

      voidtest(void)

      {char*str=NULL;

      getmemory(&str,100);

      strcpy(str,"hello");

      printf(str);

      }

      運行

      test函數(shù)有什么結(jié)果?()

    華為筆試題及分析目(C語言篇)

    標簽:面試筆試 時間:2021-02-11
    【yjbys.com - 面試筆試】

    華為筆試題及分析目(C語言篇)

    一、判斷題(對的寫T,錯的'寫F并說明原因,每小題4分,共20分)

    1、有數(shù)組定義int a[2][2]={{1},{2,3}};則a[0][1]的值為0。( )

    2、int (*ptr) (),則ptr是一維數(shù)組的名字。( )

    3、指針在任何情況下都可進行>, <, >=, <=, = =運算。( )

    4、switch(c) 語句中c可以是int, long, char, float, unsigned int 類型。( )

    5、#define print(x) printf("the no, "#x",is ")

    二、填空題(共30分)

    1、在windows下,寫出運行結(jié)果,每空2分,共10分。

    char str[ ]= "Hello";

    char *p=str;

    int n=10;

    sizeof(str)=( )

    sizeof(p)=( )

    sizeof(n)=( )

    void func(char str[100])

    { }

    sizeof(str)=( )

    2、void setmemory(char **p, int num)

    { *p=(char *) malloc(num);}

    void test(void)

    { char *str=NULL;

    getmemory(&str,100);

    strcpy(str,"hello");

    printf(str);

    }

    運行test函數(shù)有什么結(jié)果?( )10分

    華為的最近的C語言筆試題

    標簽:綜合指導(dǎo) 時間:2021-02-11
    【yjbys.com - 綜合指導(dǎo)】

    一、判斷題(對的寫T,錯的.寫F并說明原因,每小題4分,共20分)

    1、有數(shù)組定義int a[2][2]={{1},{2,3}};則a[0][1]的值為0。( )

    2、int (*ptr) (),則ptr是一維數(shù)組的名字。( )

    3、指針在任何情況下都可進行>, <, >=, <=, = =運算。( )

    4、switch(c) 語句中c可以是int, long, char, float, unsigned int 類型。( )

    5、#define print(x) printf("the no, "#x",is ")

    二、填空題(共30分)

    1、在windows下,寫出運行結(jié)果,每空2分,共10分。

    char str[ ]= "Hello";

    char *p=str;

    int n=10;

    sizeof(str)=( )

    sizeof(p)=( )

    sizeof(n)=( )

    void func(char str[100])

    { }

    sizeof(str)=( )

    2、void setmemory(char **p, int num)

    { *p=(char *) malloc(num);}

    void test(void)

    { char *str=NULL;

    getmemory(&str,100);

    strcpy(str,"hello");

    printf(str);

    2012年華為C語言筆試題

    標簽:筆試題目 時間:2021-01-15
    【yjbys.com - 筆試題目】

      各位朋友們,如果想要知道2012年華為C語言主要考查的,那么,敬請關(guān)注下文:

      一、判斷題(對的寫T,錯的'寫F并說明原因,每小題4分,共20分)

      1、有數(shù)組定義inta[2][2]={{1},{2,3}};則a[0][1]的值為0。()

      2、int(*ptr)(),則ptr是一維數(shù)組的名字。()

      3、指針在任何情況下都可進行>,<,>=,<=,==運算。()

      4、switch(c)語句中c可以是int,long,char,float,unsignedint類型。()

      5、#defineprint(x)printf("theno,"#x",is")

      二、填空題(共30分)

      1、在windows下,寫出運行結(jié)果,每空2分,共10分。

      charstr[]="Hello";

      char*p=str;

      intn=10;

      sizeof(str)=()

      sizeof(p)=()

      sizeof(n)=()

      voidfunc(charstr[100])

      {}

      sizeof(str)=()

      2、voidsetmemory(char**p,intnum)

      {*p=(char*)malloc(num);}

      voidtest(void)

      {char*str=NULL;

      getmemory(&str,100);

    華為最新C語言筆試題目

    標簽:筆試題目 時間:2020-12-14
    【yjbys.com - 筆試題目】

      一、判斷

      1、有數(shù)組定義inta[2][2]={{1},{2,3}};則a[0][1]的值為0。()

      2、int(*ptr)(),則ptr是一維數(shù)組的名字。()

      3、指針在任何情況下都可進行>,<,>=,<=,==運算。()

      4、switch(c)語句中c可以是int,long,char,float,unsignedint類型。()

      5、#defineprint(x)printf("theno,"#x",is")

      二、填空

      1、在windows下,寫出運行結(jié)果,每空2分,共10分。

      charstr[]="Hello";

      char*p=str;

      intn=10;

      sizeof(str)=()

      sizeof(p)=()

      sizeof(n)=()

      voidfunc(charstr[100])

      {}

      sizeof(str)=()

      2、voidsetmemory(char**p,intnum)

      {*p=(char*)malloc(num);}

      voidtest(void)

      {char*str=NULL;

      getmemory(&str,100);

      strcpy(str,"hello");

      printf(str);

      }

      運行

      test函數(shù)有什么結(jié)果?()

    華為C語言類筆試題目

    標簽:筆試題目 時間:2020-12-08
    【yjbys.com - 筆試題目】

    一、判斷題(對的寫T,錯的`寫F并說明原因,每小題4分,共20分)

      1、有數(shù)組定義inta[2][2]={{1},{2,3}};則a[0][1]的值為0。()

      2、int(*ptr)(),則ptr是一維數(shù)組的名字。()

      3、指針在任何情況下都可進行>,<,>=,<=,==運算。()

      4、switch(c)語句中c可以是int,long,char,float,unsignedint類型。()

      5、#defineprint(x)printf("theno,"#x",is")

      二、填空題(共30分)

      1、在windows下,寫出運行結(jié)果,每空2分,共10分。

      charstr[]="Hello";

      char*p=str;

      intn=10;

      sizeof(str)=()

      sizeof(p)=()

      sizeof(n)=()

      voidfunc(charstr[100])

      {}

      sizeof(str)=()

      2、voidsetmemory(char**p,intnum)

      {*p=(char*)malloc(num);}

      voidtest(void)

      {char*str=NULL;

      getmemory(&str,100);

      strcpy(str,"hello");

    華為c語言筆試面試題題庫

    標簽:華為認證 時間:2020-11-09
    【yjbys.com - 華為認證】

      你知道什么是華為認證嗎?華為認證涉及到什么程序語言呢?下面yjbys小編就為大家揭曉關(guān)于華為認證的筆試面試題庫及答案,希望對大家有所幫助!

      1、局部變量能否和全局變量重名

      答:能,局部會屏蔽全局。要用全局變量,需要使用"::"

      局部變量可以與全局變量同名,在函數(shù)內(nèi)引用這個變量時,會用到同名的局部變量,而不會用到全局變量。對于有些編譯器而言,在同一個函數(shù)內(nèi)可以定義多個同名的局部變量,比如在兩個循環(huán)體內(nèi)都定義一個同名的局部變量,而那個局部變量的作用域就在那個循環(huán)體內(nèi)。

      2、如何引用一個已經(jīng)定義過的全局變量

      答:extern

      可以用引用頭文件的方式,也可以用extern關(guān)鍵字,如果用引用頭文件方式來引用某個在頭文件中聲明的全局變理,假定你將那個變寫錯了,那么在編譯期間會報錯,如果你用extern方式引用時,假定你犯了同樣的錯誤,那么在編譯期間不會報錯,而在連接期間報錯。

      3、全局變量可不可以定義在可被多個.C文件包含的頭文件中 為什么

      答:可以,在不同的C文件中以static形式來聲明同名全局變量。

      可以在不同的C文件中聲明同名的全局變量,前提是其中只能有一個C文件中對此變量賦初值,此時連接不會出錯

      4、語句for( ;1 ;)有什么問題 它是什么意思

      答:和while(1)相同。

      5、do……while和while……do有什么區(qū)別

    華為招聘-C語言筆試試題

    標簽:筆試題目 時間:2020-11-07
    【yjbys.com - 筆試題目】

    一、判斷題(對的寫T,錯的寫F并說明原因,每小題4分,共20分)
    1、有數(shù)組定義int a[2][2]={{1},{2,3}};則a[0][1]的值為0。(     )
    2、int (*ptr) (),則ptr是一維數(shù)組的'名字。(     )
    3、指針在任何情況下都可進行>,<,>=,<=,==運算。(     )
    4、switch(c) 語句中c可以是int ,long,char ,float ,unsigned int 類型。(   )
    5、#define print(x)  printf("the no, "#x",is ")
     
    二、填空題(共30分)
    1、在windows下,寫出運行結(jié)果,每空2分,共10分。
    char str[ ]= "Hello";
    char *p=str;
    int n=10;
    sizeof(str)=(      )
    sizeof(p)=(       )
    sizeof(n)=(       )
    void func(char str[100])
    {    }
    sizeof(str)=(     )
     
    2、void setmemory(char **p, int num)
    { *p=(char *) malloc(num);}
    void test(void)
    {  char *str=NULL;
       getmemory(&str,100);
       strcpy(str,"hello");
       printf(str);
    }
    運行test函數(shù)有什么結(jié)果?(                                )10分
     
    3、設(shè)int arr[]={6,7,8,9,10};
         int *ptr=arr;
       *(ptr++)+=123;
     printf("%d,%d",*ptr,*(++ptr));
    (                                   ) 10分
     
    二、編程題(第一小題20,第二小題30分)
    1、  不使用庫函數(shù),編寫函數(shù)int strcmp(char  *source, char *dest)
    相等返回0,不等返回-1;
     2、  寫一函數(shù)int fun(char *p)判斷一字符串是否為回文,是返回1,不是返回0,出錯返回-1
    五、 閱讀程序題(每個小題5分,共20分)
    1.閱讀以下程序,概括地寫出程序的功能。
    #i nclude
    double Exp(double x)
    { double sum=1.0;
    double term=x;
    double i=1 ;
    while (term>=1.0E-8)
    { sum+=term ;
    i++;
    term=term*x/i ;
    }
    return sum ;
    }
    void main()
    { double s;
    s=Exp(1.0)+Exp(2.0);
    cout.precision(8);
    cout<<"s="<<
    }
    2. 閱讀程序,寫出程序執(zhí)行時輸出結(jié)果。
    #i nclude
    const int SIZE=10;
    class stack
    { char stck[SIZE];
    int top;
    public:
    void init();
    void push(char ch);
    char pop();
    };
    void stack::init()
    { top=0; }
    void stack::push(char ch)
    { if(top==SIZE)
     { cout<<"Stack is full.\n";
    return ;
     }
    stck[top++]=ch;
    }
    char stack::pop()
    { if(top==0)
       { cout<<"Stack is empty.\n";
       return 0;
    }
    return stck[--top];
    }
    void main()
    { stack s1, s2;
     s1.init();
     s2.init();
     s1.push('a');
     s1.push('b');
     s1.push('c');
     s2.push('x');
     s2.push('y');
     s2.push('z');
     for(int i=0; i<3; i++)
    cout<<"Pop s1:"<<
     for(i=0; i<3; i++)
    cout<<"Pop s2:"<<
    }
    程序結(jié)果:
    3.閱讀程序,寫出程序運行時輸出結(jié)果。
    #i nclude
    class Tdate
    { public:
    Tdate();
    Tdate(int d);
    Tdate(int m, int d);
    Tdate(int m, int d, int y);
    protected:
    int month;
    int day;
    int year;
    };
    Tdate::Tdate()
    { month=4;
       day=15;
       year=1995;
    cout<<<"/" <<<"/" <<
    }
    Tdate::Tdate(int d)
    { month=4;
       day=d;
      year=1996;
    cout<<<"/" <<<"/" <<
    }
    Tdate::Tdate(int m, int d)
    { month=m;
       day=d;
       year=1997;
    cout<<<"/" <<<"/" <<
    }
    Tdate::Tdate(int m, int d, int y)
    { month=m;
       day=d;
       year=y;
    cout<<<"/" <<<"/" <<
    }
    void main()
    { Tdate aday;
    Tdate bday(10);
    Tdate cday(2,12);
    Tdate dday(1,2,1998);
    }
    運行結(jié)果:
    4.閱讀程序,寫出程序運行時輸出結(jié)果。
    #i nclude
    #i nclude
    class shape
    { public:
    shape(double x, double y):xCoord(x), yCoord(y){}
    virtual double Area()const {return 0.0; }
    protected:
    double xCoord, yCoord;
    };
    class AA :public shape
    { public:
    AA(double x, double y, double r): shape(x,y), rad(r){}
    virtual double Area()const { return 3.0 * rad * rad; }
    protected:
    double rad;
    };
    class BB :public shape
    { public:
    BB(double x1, double y1, double x2, double y2)
    :shape(x1, y1), x2Coord(x2), y2Coord(y2){ }
    virtual double Area()const;
    protected:
    double x2Coord, y2Coord;
    };
    double BB:Area()const
    { return fabs((xCoord-x2Coord)* (yCoord - y2Coord));
    //庫函數(shù)fabs(double t)求得t的絕對值
    }
    void fun(const shape& sp)
    { cout<<
    }
    void main()
    { AA aa(2.0, 5.0, 4.0);
    fun(aa);
    BB bb(2.0, 8.0, 12.0, 17.0);
    fun(bb);
    }
    運行結(jié)果:
    六、 編寫程序題(每小題10分,共20分)
    1.編寫一個函數(shù)int Judge(int *pArray, int n),判斷一個n×n二維整數(shù)數(shù)組pArray 是否為“魔方陣”,若是返回1,否則返回0。所謂魔方陣就是將1到n2的各個數(shù)字組成的方陣,它的每一行、每一列以及兩個對角線上數(shù)字之和均相等。例如,3×3的中,A是魔方陣,而B不是魔方陣。然后在主程序中調(diào)用Judge函數(shù)判斷數(shù)組A是否為魔方陣。
    參考程序
    #i nclude
    int Judge(int *pArray, int n)
    { int s1, s2, s3,s4,sum=0;
    int *p=pArray;
    for(int i=1; i<= n*n; i++)
    { int Found=0; //為0,不在方陣中;
    for(int j=0; j
    if(p[j]==i)
    { Found=1; //為1,在方陣中
    break;
    }
    if(Found==0) return 0; // 值為 i 的元素不在數(shù)組中,顯然不是魔方陣
    }
    for( i=1; i<=n*n; i++)
    sum=sum+i;
    sum=sum / n; // 各行、各列、對角線元素應(yīng)當(dāng)?shù)玫降暮?
    s3=0;
    s4=0;
    for( i=0; i
    { s1=0, s2=0;
    p=pArray;
    for(int j=0; j
    { s1=s1+p[i*n+j]; //第i行的元素和
     s2=s2+p[j*n+i]; //第i列的元素和
    }
    if ( s1!=sum)
    return 0;
    if ( s2!=sum)
    return 0;
    s3=s3+pArray[i*n+i];     // 對角線一元素和
    s4=s4+pArray[i*n+(n-1-i)]; // 對角線二元素和
    }
    if(s3!=sum)
    return 0;
    if(s4 != sum)
    return 0;
    return 1;
    }
    void main()
    { int Array[3][3]={{ 8, 1, 6},{ 3, 5, 7},{ 4, 9, 2}};
    當(dāng) x 輸入值為9999時,函數(shù)返回值為多少?
    int fun ( unsigned int x )
    { int count = 0;
    while(x)
    {
    x = x & (x-1);
    count++;
    }
    return count;
    }
    答案:此函數(shù)是在計算 x 中含有1的個數(shù),所以返回值為8。
    if(Judge((int*)Array, 3))
    cout<<"Yes, it's a magic array"<
    else
    cout<<"No, it isn't a magic array"<
    }
    /*********************************
    * 兩個超大數(shù)相乘算法
    *********************************/
    #i nclude
    void main()
    {
    int a[30],b[30],c[60];
    int i,j;
    /* 給乘數(shù)和被乘數(shù)賦值,并把結(jié)果賦零 */
    for (i=0;i<30;i++)
    {
    a[i]=i%10;
    b[i]=i%10;
    c[2*i]=0;
    c[2*i+1]=0;
    }
    /* 給每位結(jié)果賦值,這里應(yīng)該考慮清楚為什么這么寫
    還有這里的位的值的最大限度應(yīng)該是-128 -- +127
    所以就算是10*10也可以滿足存進去一個char類型里 */
    for(i=0;i<30;i++)
    for(j=0;j<30;j++)
    c[i+j]+=a[i]*b[j];
    /* 這里把每個位>10的數(shù)進位和把余數(shù)重新賦值給這一位 */
    for(i=0;i<59;i++)
    {
    c[i+1]+=c[i]/10;
    c[i]=c[i]%10;
    }
    /* 打印出來 */
    for(i=0;i<30;i++)
    printf("%d",a[30-i-1]);
    printf("\n");
    for(i=0;i<30;i++)
    printf("%d",b[30-i-1]);
    printf("\n");
    for(i=0;i<60;i++)
    printf("%d",c[60-i-1]);
    printf("\n");
    }

    主站蜘蛛池模板: 国产精品久久永久免费| 丰满人妻熟妇乱又伦精品劲| 日韩精品在线一区二区| 亚洲国产精品一区二区三区久久| 久久国产乱子伦精品免费强| 亚洲精品自在在线观看| wwwvr高清亚洲精品二区| 日韩精品真人荷官无码| 精品国产一区二区22| 2022国产精品不卡a| 亚洲精品成a人在线观看| 国产精品成人久久久久三级午夜电影| 国产乱码精品一品二品| 亚洲?V无码乱码国产精品| 国产精品美女久久久久AV福利| 99在线精品一区二区三区| 亚洲韩精品欧美一区二区三区| 国产精品玖玖美女张开腿让男人桶爽免费看 | 精品国产国产综合精品| 国产精品一区在线播放| 精品久久久久久亚洲精品| 亚洲精品无码久久不卡| 国产情侣大量精品视频| 丁香色婷婷国产精品视频| 青青草精品视频| 精品久久香蕉国产线看观看亚洲| 囯产精品一品二区三区| 久久99国产综合精品免费| 亚洲性日韩精品国产一区二区| 欧美人与性动交α欧美精品成人色XXXX视频 | 国产精品无码专区| 午夜精品乱人伦小说区| 宅男在线国产精品无码| 日本精品视频在线观看| 精品欧美激情在线看| 国产精品哟女在线观看| 高清在线国产午夜精品| 国产成人综合久久精品尤物| 香蕉国产精品频视| 免费欧美精品a在线| 伊人久久精品线影院|