返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. #include<ctime>
  4. using namespace std;
  5. int main()
  6. {
  7.     srand(time(NULL));
  8.     re:
  9.     system("cls");
  10.     int a ,b;
  11.     string n[]={"1","2","3","4","5","6","7","8","9","10","J","Q","K"};
  12.     a=rand()%4+3;
  13.     b=rand()%13;
  14.     cout<<"你抽到的牌是:"<<char(a)<<n[b]<<endl<<endl;
  15.     system("pause");
  16.     goto re;
  17.     return 0;
  18. }
複製代碼

TOP

返回列表