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

TOP

返回列表