返回列表 發帖
本帖最後由 劉泳鱔 於 2014-1-11 15:25 編輯
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int a, b;
  7.     srand(time(NULL));
  8.     re:
  9.     a=rand()%4+3;
  10.     b=rand()%13+1;
  11.     cout<<"你抽的是: ";
  12.     cout<<char(a);
  13.     if(b==1)
  14.     cout<<"A"<<endl;
  15.     else if(b==11)
  16.     cout<<"J"<<endl;
  17.     else if(b==12)
  18.     cout<<"Q"<<endl;
  19.     else if(b==13)
  20.     cout<<"K"<<endl;
  21.     else
  22.     cout<<b<<endl;
  23.     system("pause");
  24.     goto re;
  25.     system("pause");
  26.     return 0;   
  27. }
複製代碼
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int a, b;
  7.     srand(time(NULL));
  8.     re:
  9.     a=rand()%4+3;
  10.     b=rand()13+1
  11.     cout<<"你抽的是: ";
  12.     cout<<char(a)
  13.     if(b==1)
  14.     cout<<"A"<<endl;
  15.     else if(b==11)
  16.     cout<<"j"<<endl;
  17.     else  if(b==12)
  18.     cout<<"Q"<<endl;
  19.     else  if(b==13)
  20.     cout<<"K"<<endl;
  21.     else
  22.     cout<<b<<endl;
  23.     system("pause");
  24.     goto re;
  25.     system("pause");
  26.     return 0;   
  27. }
複製代碼

TOP

返回列表