返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     srand(time(NULL));
  7.     int p=rand()%4+3;
  8.     int n=rand()%13+1;
  9.     cout<<"您抽到的牌是:"<<char(p);
  10.     if(n==1)
  11.     {
  12.         cout<<"A";
  13.     }
  14.     else if(n==11)
  15.     {
  16.         cout<<"J";
  17.     }
  18.     else if(n==12)
  19.     {
  20.         cout<<"Q";
  21.     }
  22.     else if(n==13)
  23.     {
  24.         cout<<"K";
  25.     }
  26.     else
  27.     {
  28.         cout<<n;
  29.     }
  30.     cout<<endl;
  31.     system("pause");
  32.     return 0;   
  33. }
複製代碼

TOP

返回列表