色逼阁网页,在线看的h网导航,亚洲日韩aⅴ在线视频,小清欢在线全文阅读,AV电影网址免费观看,自拍偷拍影音先锋,多人疯狂派对欧美XXX,强奸福利社,东北女人大叫受不了了

c面試題目(2)

時間:2024-06-30 05:54:04 學人智庫 我要投稿
  • 相關推薦

c面試題目(2)

  {

c面試題目(2)

  stra[i++]=num%10+48;

  num=num/10;

  }

  stra[i] = '\0';

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

  {

  strb[j] = stra[i-j-1];

  }

  strb[j] = '\0';

  cout<

  }

  int main()

  {

  int num;

  cin>>num;

  itochar(num);

  return 0;

  }

  3、求組合數: 求 n 個數(1....n)中 k 個數的組合....

  如:combination(5,3)

  要求輸出:543,542,541,532,531,521,432,431,421,321,

  #include

  int pop(int *);

  int push(int );

  void combination(int ,int );

  int stack[3]={0};

  top=-1;

  int main()

  {

  int n,m;

  printf("Input two numbers:\n");

  while( (2!=scanf("%d%*c%d",&n,&m)) )

  {

  fflush(stdin);

  printf("Input error! Again:\n");

  }

  combination(n,m);

  printf("\n");

  }

  void combination(int m,int n)

  {

  int temp=m;

  push(temp);

  while(1)

  {

  if(1==temp)

  {

  if(pop(&temp)&&stack[0]==n) //當棧底元素彈出&&為可能取的最小值,循環退出break;

  }

  else if( push(--temp))

  {

  printf("%d%d%d ",stack[0],stack[1],stack[2]);//§¨ì¤@?

  pop(&temp);

  }

  }

  }

  int push(int i)

  {

  stack[++top]=i;

  if(top<2)

  return 0;

  else

  return 1;

  }

  int pop(int *i)

  {

  *i=stack[top--];

  if(top>=0)

  return 0;

  else

  return 1;

http://m.rusnota.com/

【c面試題目(2)】相關文章:

海信面試英語題目07-05

hr面試問題題目及面試技巧08-09

師德師風的征文題目(2)08-14

android面試題目09-08

星巴克面試英語題目08-06

文員面試題目10-14

面試必要備5個C10-01

c1和c2駕照考試的區別08-02

小升初名校面試題目10-11

鄭州小升初面試題目06-05