
在这里插入代码片
#include<stdio.h>
int main()
{
char s[54] = { 0 };
int arr[14] = { 0 };
char c;
int count = 0;
int ten;
scanf("%s", &s);
for (int i = 0; i < 54; i++) {
if ((s[i] - '0') >= 2 && (s[i] - '0') <= 9)
arr[s[i] - '0']++;
else if (s[i] == 'A')
arr[1]++;
else if (s[i] == '1')
arr[10]++;
else if (s[i] == 'J')
arr[11]++;
else if (s[i] == 'Q')
arr[12]++;
else if (s[i] == 'K')
arr[13]++;
}
for (int j = 1; j < 14; j++) {
if (arr[j] >= 4) {
count = 1;
if (j > 1 && j < 10)
c = j + '0';
else if (j == 1)
c = 'A';
else if (j == 10)
ten = 10;
else if (j == 11)
c = 'J';
else if (j == 12)
c = 'Q';
else c = 'K';
}
}
if (count == 1) {
if (ten == 10)
printf("%d", ten);
else
printf("%c", c);
}
else
printf("DAMN");
return 0;
}
