use*_*608 1 c++ random numbers srand
我需要像rand()这样的东西,但我只希望每个数字一次.
在示例中,我有10个".txt"文件,这些文件被命名为数字(1-10).我想读一下里面的东西,然后cout它,但随机.
我不想1.txt - > 2.txt - > 3.txt - > ...但是随机的东西就像
5.txt - > 4.txt - > 1.txt - > ...
每个号码只应出现一次
是否有捷径可寻?
string Path = "./Questions_Niko/" + random + ".txt";
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1267 次 |
| 最近记录: |