unsigned long long calcDigitFactorial(std::string n) { unsigned long long sum = 0; for(unsigned long long i = 0; i<n.length(); i++) { sum += factorial(Char2Int(n.at(i))); } return sum; }
std::vector<unsigned long long> getDigits(unsigned long long n) { std::string s = Long2Str(n); std::vector<unsigned long long> v(10); for(unsigned long long i = 0; i<s.length(); i++) { v.at(Char2Int(s.at(i)))++; } return v; }
int hold_strategy_2() { Char2Int(); if(pointInt[0][0]==pointInt[1][0]&&pointInt[0][0]>2&&pointInt[1][0]>2) return 1; else if(pointInt[0][0]>3&&pointInt[1][0]>3&&color[0][0]==color[1][0]) return 1; else if((pointInt[0][0]>11||pointInt[1][0]>11)&&pointInt[0][0]>4&&pointInt[1][0]>4) return 1; else return 0; }
int hold_strategy_1() { Char2Int(); if(pointInt[0][0]==pointInt[1][0]&&pointInt[0][0]>7&&pointInt[1][0]>7) return 1; else if(pointInt[0][0]>9&&pointInt[1][0]>9&&color[0][0]==color[1][0]) return 1; else if((pointInt[0][0]==14||pointInt[1][0]==14)&&pointInt[0][0]>11&&pointInt[1][0]>11) return 1; else return 0; }
void sort(int length) { Char2Int(); int i,j; for (i = 0; i < length; i++) { for (j = i; j< length; j++) { int tmp = pointInt[i][0]; if (pointInt[i][0]>pointInt[j][0]) { tmp = pointInt[i][0]; pointInt[i][0] = pointInt[j][0]; pointInt[j][0] = tmp; } } } }
int strategy_3() { //1对 int i=0,j=0; int flag = 0; Char2Int(); for (i=0; i<5; i++) { for (j=i+1; j<5; j++) { if (pointInt[j][0] == pointInt[i][0]) { flag ++ ; }//end if else continue; }//end infor }//end outfor if (flag >= 1) { return 1; } else return 0; }