返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. #include<ctime>
  4. using namespace std;
  5. int main()
  6. {
  7.     int sum;
  8.     srand(time(NULL));
  9.     for(int i=1;i<=20;i++){
  10.         int n[4]={11,11,11,11};   
  11.         for(int o=1;o<=4;o++){
  12.             s:
  13.             sum=rand()%10;
  14.             if(sum==n[0] || sum==n[1] || sum==n[2] || sum==n[3]){
  15.                 goto s;
  16.             }else{
  17.                 n[o-1]=sum;
  18.             }
  19.             cout<<n[o-1]<<" ";
  20.         }
  21.         cout<<endl;
  22.         _sleep(500);
  23.    
  24.     }
  25.     system("pause");
  26.     return 0;
  27. }
複製代碼
hahahahahahahaha

TOP

返回列表