日韩亚洲专区中文字幕|五月天国产精品免费视频|中文字幕乱码亚州无线码二区|亚洲中文免费AV

<ul id="eu2wk"><blockquote id="eu2wk"></blockquote></ul>
  • <td id="eu2wk"><code id="eu2wk"></code></td>

    當(dāng)前位置:高考升學(xué)網(wǎng) > 招聘筆試題 > 正文

    龍旗控股筆試題和面試題答案

    更新:2023-09-20 13:36:47 高考升學(xué)網(wǎng)

      龍旗控股筆試題分享,歡迎大家閱讀和練習(xí)!
      一、選擇題

      1. 下列程序的運行結(jié)果是

      # define A 5

      # define B A+1

      main( )

      {

      int a;

      a=B;

      printf(″%d\n″a--);

      }

      A.6

      B.5

      C.4

      D.出錯

      2. 設(shè)int i,x[3][3]={1,2,3,4,5,6,7,8,9};則下面語句

      for(i=0;i<3;i++)

      printf(″%d″,x[i][2-i]);

      的輸出結(jié)果是

      A.147

      B.159

      C.357

      D.369

      3. 設(shè)有以下程序段:int a=1, b=10, c=1, x;x=a&&b||++c;printf(″%d, %d\n″,x,c);執(zhí)行后輸出的結(jié)果是

      A.0,0

      B.0,1

      C.1,0

      D.1,1

      4. 假定a和b為int型變量,則執(zhí)行下述語句組后,b的值為

      a=1;

      b=10;

      do

      {

      b-=a;

      a++;

      } while (b--<0);

      A.9

      B.-2

      C.-1

      D.8

      5. 設(shè)int a = 3;則表達(dá)式a<1&&--a>1的運算結(jié)果和a的值分別是

      A.0和2

      B.0和3

      C.1和2

      D.1和3

      6. 表達(dá)式“sizeof(int )/sizeof(int)”的值為_____。

      A 1 B 2 C 3 D 4

      二、專業(yè)題

      1.Windows NT下的32位機(jī)運行環(huán)境下:

      char str[]=“Hello”;

      char p =str;

      int n = 10;

      請計算strlen(str),sizeof(str),sizeof(p),sizeof(n)

      5, 6, 4, 4

      2.請編碼實現(xiàn)以下功能的函數(shù)

      功能:實現(xiàn)對一個8 bit數(shù)據(jù)(unsigned char類型)的指定位(例如第n位)的置0或者置1操作,并保持其他位不變。

      函數(shù)原型:void bit_set(unsigned charp_data,unsigned char position,bool flag)

      函數(shù)參數(shù)說明:p_data是指定的源數(shù)據(jù),position是指定位(取值范圍1~8),flag表示是置0還是置1操作

      #include

      #include

      void bit_set(unsigned char p_data,unsignedchar position,bool flag)

      {

      int times=position-'0'-1;

      if(flag==0)

      {

      p_data= (p_data)&(~(0x01<

      }

      if(flag==1)

      {

      p_data= (p_data)| (0x01<

      }

      printf("===%d\n",p_data);

      }

      int main(int argc,char argv[])

      {

      unsignedchar a;

      unsignedchar num;

      scanf("%c",&a);

      getchar();

      scanf("%c",&num);

      bit_set(&a,num,0);

      printf("%d\n",a);

      return1;

      }

      3.請用C語言實現(xiàn)字符串右循環(huán)移位函數(shù),比如〞abcdefghi〞循環(huán)右移2位就是〞hiabcdefg〞。

      函數(shù)原型:void RightLoopMove(char pStr,unsignedshort steps)

      參數(shù)說明:

      pStr:Pointer to aˊ\0ˊterminated string

      steps:The rotate shift numbers

      #include

      #include

      #include

      voidRightLoopMove(char pStr,unsigned short steps)

      {

      unsigned short i=strlen(pStr);

      int num=0;

      char temp[10];

      for(;num

      {

      static int length=i-steps;

      temp[num]=pStr[length];

      length++ ;

      }

      for(num=i-1-steps;num>=0;num--)

      {

      pStr[num+steps]=pStr[num];

      }

      for(num=0;num

      {

      pStr[num]=temp[num];

      }

      }

      intmain(int argc,char argv[])

      {

      char str[20]="abcdefghi";

      RightLoopMove(str,2);

      printf("%s\n",str);

      return 1;

      }

    最新圖文