返回列表 發帖
  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int a[10];
  7.     cout<<"我拿到的球為:";
  8.     for(int i=0; i<=9; i++)
  9.     {
  10.         re:
  11.         a[i]=rand()%38+1;
  12.         for(int j=0; j<i; j++)
  13.         {
  14.             if(a[i]==a[j])
  15.             {
  16.                 goto re;
  17.             }
  18.         }
  19.     }
  20.     for(int i=0; i<=9; i++)
  21.     {
  22.         cout<<a[i]<<" ";
  23.         _sleep(500);
  24.     }
  25.     system("pause");
  26.     return 0;
  27. }
複製代碼

TOP

返回列表