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