赞
踩
一般用法:
- #include <time.h>
- #include <stdlib.h>
- #include <iostream>
-
- using namespace std;
- int main(int argc, const char * argv[])
- {
- srand((unsigned int) time(NULL));
- for (int i = 0; i < 10; ++i) {
- cout<<rand() % 100 <<endl;
- }
- return 0;
- }
参考:
https://www.cnblogs.com/VVingerfly/p/5990714.html
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。