- #include<iostream>
- #include<cstdlib>
- #include<string>
- using namespace std;
- int main()
- {
- srand(time(NULL));
- re:
- system("cls");
- int gg=rand()%4+3;
- int ggking=rand()%13+1;
- cout<<"您抽到的牌是: "<<char(gg);
- if(ggking==1)
- cout<<"A";
- else if(ggking==11)
- cout<<"J";
- else if(ggking=12)
- cout<<"Q";
- else if(ggking==13)
- cout<<"K";
- else
- cout<<ggking;
- cout<<endl;
- system("pause");
- goto re;
- system("pause");
- return 0;
- }
複製代碼 |