<pre id="bbfd9"><del id="bbfd9"><dfn id="bbfd9"></dfn></del></pre>

          <ruby id="bbfd9"></ruby><p id="bbfd9"><mark id="bbfd9"></mark></p>

          <p id="bbfd9"></p>

          <p id="bbfd9"><cite id="bbfd9"></cite></p>

            <th id="bbfd9"><form id="bbfd9"><dl id="bbfd9"></dl></form></th>

            <p id="bbfd9"><cite id="bbfd9"></cite></p><p id="bbfd9"></p>
            <p id="bbfd9"><cite id="bbfd9"><progress id="bbfd9"></progress></cite></p>

            華為c語言筆試

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

            華為C語言筆試題

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

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

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

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

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

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

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

              二、填空題(共30分)

              1、在windows下,寫出運行結果,每空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、有數組定義int a[2][2]={{1},{2,3}};則a[0][1]的值為0。( )

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

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

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

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

            二、填空題(共30分)

            1、在windows下,寫出運行結果,每空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函數有什么結果?( )10分

            華為C語言筆試題目分享

            標簽:綜合指導 時間:2021-03-18
            【yjbys.com - 綜合指導】

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

              一、判斷

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

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

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

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

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

              二、填空

              1、在windows下,寫出運行結果,每空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函數有什么結果?()

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

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

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

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

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

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

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

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

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

            二、填空題(共30分)

            1、在windows下,寫出運行結果,每空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函數有什么結果?( )10分

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

            標簽:綜合指導 時間:2021-02-11
            【yjbys.com - 綜合指導】

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

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

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

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

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

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

            二、填空題(共30分)

            1、在windows下,寫出運行結果,每空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語言主要考查的,那么,敬請關注下文:

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

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

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

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

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

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

              二、填空題(共30分)

              1、在windows下,寫出運行結果,每空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、有數組定義inta[2][2]={{1},{2,3}};則a[0][1]的值為0。()

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

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

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

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

              二、填空

              1、在windows下,寫出運行結果,每空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函數有什么結果?()

            華為C語言類筆試題目

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

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

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

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

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

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

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

              二、填空題(共30分)

              1、在windows下,寫出運行結果,每空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小編就為大家揭曉關于華為認證的筆試面試題庫及答案,希望對大家有所幫助!

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

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

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

              2、如何引用一個已經定義過的全局變量

              答:extern

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

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

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

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

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

              答:和while(1)相同。

              5、do……while和while……do有什么區別

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

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

            一、判斷題(對的寫T,錯的寫F并說明原因,每小題4分,共20分)
            1、有數組定義int a[2][2]={{1},{2,3}};則a[0][1]的值為0。(     )
            2、int (*ptr) (),則ptr是一維數組的'名字。(     )
            3、指針在任何情況下都可進行>,<,>=,<=,==運算。(     )
            4、switch(c) 語句中c可以是int ,long,char ,float ,unsigned int 類型。(   )
            5、#define print(x)  printf("the no, "#x",is ")
             
            二、填空題(共30分)
            1、在windows下,寫出運行結果,每空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函數有什么結果?(                                )10分
             
            3、設int arr[]={6,7,8,9,10};
                 int *ptr=arr;
               *(ptr++)+=123;
             printf("%d,%d",*ptr,*(++ptr));
            (                                   ) 10分
             
            二、編程題(第一小題20,第二小題30分)
            1、  不使用庫函數,編寫函數int strcmp(char  *source, char *dest)
            相等返回0,不等返回-1;
             2、  寫一函數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. 閱讀程序,寫出程序執行時輸出結果。
            #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:"<<
            }
            程序結果:
            3.閱讀程序,寫出程序運行時輸出結果。
            #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);
            }
            運行結果:
            4.閱讀程序,寫出程序運行時輸出結果。
            #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));
            //庫函數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);
            }
            運行結果:
            六、 編寫程序題(每小題10分,共20分)
            1.編寫一個函數int Judge(int *pArray, int n),判斷一個n×n二維整數數組pArray 是否為“魔方陣”,若是返回1,否則返回0。所謂魔方陣就是將1到n2的各個數字組成的方陣,它的每一行、每一列以及兩個對角線上數字之和均相等。例如,3×3的中,A是魔方陣,而B不是魔方陣。然后在主程序中調用Judge函數判斷數組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 的元素不在數組中,顯然不是魔方陣
            }
            for( i=1; i<=n*n; i++)
            sum=sum+i;
            sum=sum / n; // 各行、各列、對角線元素應當得到的和
            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}};
            當 x 輸入值為9999時,函數返回值為多少?
            int fun ( unsigned int x )
            { int count = 0;
            while(x)
            {
            x = x & (x-1);
            count++;
            }
            return count;
            }
            答案:此函數是在計算 x 中含有1的個數,所以返回值為8。
            if(Judge((int*)Array, 3))
            cout<<"Yes, it's a magic array"<
            else
            cout<<"No, it isn't a magic array"<
            }
            /*********************************
            * 兩個超大數相乘算法
            *********************************/
            #i nclude
            void main()
            {
            int a[30],b[30],c[60];
            int i,j;
            /* 給乘數和被乘數賦值,并把結果賦零 */
            for (i=0;i<30;i++)
            {
            a[i]=i%10;
            b[i]=i%10;
            c[2*i]=0;
            c[2*i+1]=0;
            }
            /* 給每位結果賦值,這里應該考慮清楚為什么這么寫
            還有這里的位的值的最大限度應該是-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的數進位和把余數重新賦值給這一位 */
            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");
            }

                    <pre id="bbfd9"><del id="bbfd9"><dfn id="bbfd9"></dfn></del></pre>

                    <ruby id="bbfd9"></ruby><p id="bbfd9"><mark id="bbfd9"></mark></p>

                    <p id="bbfd9"></p>

                    <p id="bbfd9"><cite id="bbfd9"></cite></p>

                      <th id="bbfd9"><form id="bbfd9"><dl id="bbfd9"></dl></form></th>

                      <p id="bbfd9"><cite id="bbfd9"></cite></p><p id="bbfd9"></p>
                      <p id="bbfd9"><cite id="bbfd9"><progress id="bbfd9"></progress></cite></p>
                      飘沙影院