重囗另类BBWSeⅹHD,av狼论坛,精品一卡2卡三卡4卡乱码理论,体育生gv老师浪小辉3p警察

c面試題目(2)

時間:2024-06-30 05:54:04 學(xué)人智庫 我要投稿
  • 相關(guān)推薦

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、求組合數(shù): 求 n 個數(shù)(1....n)中 k 個數(shù)的組合....

  如: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) //當(dāng)棧底元素彈出&&為可能取的最小值,循環(huá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://www.ipr-jzsc.com/

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

海信面試英語題目07-05

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

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

android面試題目09-08

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

文員面試題目10-14

面試必要備5個C10-01

c1和c2駕照考試的區(qū)別08-02

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

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

主站蜘蛛池模板: 如皋市| 久治县| 内江市| 区。| 梅州市| 麦盖提县| 邵东县| 兴业县| 瑞丽市| 和静县| 调兵山市| 北海市| 云南省| 北川| 泰州市| 柘荣县| 丰城市| 大悟县| 梅州市| 漳州市| 东山县| 寿阳县| 任丘市| 宣恩县| 辉南县| 盐山县| 尼玛县| 江北区| 通海县| 凉山| 张家界市| 武陟县| 沛县| 太谷县| 清镇市| 新兴县| 孝义市| 蓝田县| 获嘉县| 高碑店市| 北安市|