Filling an array with random numbers from 1 to 10^10 in C or C++

前端 未结 6 1118
你的背包
你的背包 2021-01-27 09:50

a part of an assignment of mine is based on an array (its size is given by the user) which contains random numbers from 1 to 10^10. Then we have to find the k-th smaller number

6条回答
  •  遥遥无期
    2021-01-27 10:39

    you forgot your return statements. at the end of find1 you should be doing:

    if (k==j)
        return arr[j];
    else if (k

提交回复
热议问题