返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. #include<ctime>
  4. using namespace std;
  5. int main()
  6. {
  7.        cout<<"從1~100取出5個數:"<<endl;
  8.       
  9.        srand(time(NULL));
  10.        for(int i=1; i<=5; i++)
  11.        {
  12.                
  13.             cout<<rand()%100+1<<endl;                                
  14.        }
  15.        system("pause");   
  16.        return 0;   
  17.    
  18.    
  19.    
  20. }
複製代碼

TOP

返回列表