表随机 [英] Table Random

查看:67
本文介绍了表随机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的,


给出一张桌子3 | 2 | 1 | 3 | 2 | 4 |

6 | 9 | 7 | 24 | 5 | 7 |

11 | 28 | 17 | 81 | 10 | 12 |

18 | 65 | 31 | 192 | 17 | 19 |

27 | 126 | 49 | 375 | 26 | 28 |


如何使用c ++从表中选择一个随机数?

Dear all,

Given a table 3 | 2 | 1 | 3 | 2 | 4 |
6 | 9 | 7 | 24 | 5 | 7 |
11 | 28 | 17 | 81 | 10 | 12 |
18 | 65 | 31 | 192 | 17 | 19 |
27 | 126 | 49 | 375 | 26 | 28 |

How to choose a random number from the table using c++?

推荐答案

我会将该表放入数组,然后确定一个介于0和数组大小之间的随机数。
i would put that table into an array and then determine a random number between 0 and the size of the array.


如何进入数组?


how to make into array?



i会将该表放入一个数组中,然后确定一个介于0和数组大小之间的随机数。
i would put that table into an array and then determine a random number between 0 and the size of the array.


此表存储在哪里?在文件中?它已经在给你的2D阵列吗?是从输入中读取吗?
Where is this table stored? In a file? Is it already in a 2D array given to you? Is it to be read from input?


这篇关于表随机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆