#include<bits/stdc++.h>
#include <windows.h>
using namespace std;
unordered_map<char,int> mp;
struct P{
    bool vis;
    int num;
};
deque<P> a[20];
int vis[100];
string s=" A23456789XJQK";
int main(){
	cout << "请问你是否要测运势? 1: 是 2: 不是\n";
	int xx;
	cin >> xx;
	if(xx!=1) return 0;
	system("cls");
	cout << "正在测运势中,请耐心等待......\n";
    srand(time(NULL)); 
	_sleep(rand()%5000);
    P st;
    for (int i=1;i<=13;i++){
        for(int j=1;j<=4;j++){
        	char l;
        	P:
            l=s[rand()%13+1];
            mp[l]++;
            if(mp[l]>4){
            	mp[l]--;
            	goto P;
			}
            if(l=='A'){
                st.num=1;
                st.vis=0;
                a[i].push_front(st);
            }else if(l=='J'){
                st.num=11;
                st.vis=0;
                a[i].push_front(st);
            }else if(l=='Q'){
                st.num=12;
                st.vis=0;
                a[i].push_front(st);
            }else if(l=='K'){
                st.num=13;
                st.vis=0;
                a[i].push_front(st);
            }else if(l=='X'){
                st.num=10;
                st.vis=0;
                a[i].push_front(st);
            }else{
                st.num=l-'0';
                st.vis=0;
                a[i].push_front(st);
            }
        }
    }
    P top;
    P top2;
    for (int t=0;t<4;t++){
        top=a[13].back();
        a[13].pop_back();
        top.vis=1;
        if(top.num==13) continue;
        while(top.num!=13){
            a[top.num].push_back(top);
            top2=top;
            top=a[top.num].front();
            a[top2.num].pop_front();
            top.vis=1;
        }
    }
    for (int i=1;i<=13;i++){
        for (int j=0;j<a[i].size();j++){
            if(a[i][j].vis) vis[a[i][j].num]++;
        }
    }
    int ans=0;
    for(int i=1;i<=12;i++){
        if(vis[i]==4) ans++;
    }
    system("cls");
    cout << "你的运势是\n";
	_sleep(500); 
    system("cls");
    if(!ans) cout << "极凶";
    else if(ans<=2) cout << "大凶";
	else if(ans<=3) cout << "凶";
	else if(ans<=5) cout << "小凶";
	else if(ans<=6) cout << "逢凶化吉";
	else if(ans<=8) cout << "小吉";
	else if(ans<=9) cout << "吉";
	else if(ans<=11) cout << "大吉";
	else cout << "极吉";
}