48 lines
1.2 KiB
C++
48 lines
1.2 KiB
C++
#include <bits/stdc++.h>
|
|
using namespace std;
|
|
const int N = 53;
|
|
int b[N];
|
|
int main() {
|
|
int n;
|
|
cin>>n;
|
|
for(int i=1;i<=n;i++){
|
|
string op;
|
|
cin>>op;
|
|
//字符 D 代表方片,字符 C 代表草花,字符 H 代表红桃,字符 S 代表黑桃
|
|
char x = op[0];
|
|
char num = op[1];
|
|
int pos = 0;
|
|
switch(x){
|
|
case 'D':
|
|
pos = 0;
|
|
break;
|
|
case 'C':
|
|
pos = 13;
|
|
break;
|
|
case 'H':
|
|
pos = 26;
|
|
break;
|
|
case 'S':
|
|
pos = 39;
|
|
break;
|
|
}
|
|
if (num <= '9' && num >= '0') pos += num - '0';
|
|
else if(num=='T')
|
|
pos += 10;
|
|
else if (num=='J')
|
|
pos += 11;
|
|
else if(num=='Q')
|
|
pos += 12;
|
|
else if(num=='K')
|
|
pos += 13;
|
|
else if(num=='A')
|
|
pos += 1;
|
|
b[pos]++;
|
|
}
|
|
int cnt = 0;
|
|
for (int i = 1; i <= 52;i++)
|
|
if (b[i]) cnt++;
|
|
|
|
cout << 52 - cnt << endl;
|
|
return 0;
|
|
} |