返回列表 發帖
  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     srand(time(NULL));
  7.     for(int i=1; i<=15; i++)
  8.         cout<<rand()%500+1000<<endl;
  9.     system("pause");         
  10.     return 0;
  11. }
複製代碼

TOP

  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     srand(time(NULL));
  7.     for(int i=1; i<=15; i++)
  8.         cout<<rand()%364+725<<endl;  //725指的最小值   364 = 最大值-最小值+1
  9.     system("pause");         
  10.     return 0;
  11. }
複製代碼

TOP

返回列表