网易校园招聘C/C++笔试题和面试题答案(3)

招聘笔试题2018-11-22才子老师

  {

  int maxnumber = data[0]

  int sec_max = MINNUMBER for ( int i = 1 i < count i++)

  {

  if ( data[i] > maxnumber )

  {

  sec_max = maxnumber

  maxnumber = data[i]

  }

  else

  {

  if ( data[i] > sec_max )

  sec_max = data[i]

  }

  }

  return sec_max

  }

相关推荐

猜你喜欢

大家正在看

换一换