返回列表 發帖
  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=rand()%4+3;
  11.    int b=rand()%13+1;
  12.    cout<<"您所抽到的牌是:"<<char(a);
  13.    if(b==1)
  14.     cout<<"A";
  15.    else if(b==11)
  16.     cout<<"J";
  17.    else if(b==12)
  18.     cout<<"Q";
  19.    else if(b==13)
  20.     cout<<"K";
  21.    else
  22.     cout<<b;
  23.     system("pause");
  24.     goto re;  
  25.     return 0;   
  26. }
複製代碼

TOP

返回列表