#include <bits/stdc++.h>
using namespace std;
long long n, sum;
string word;
int main (){
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n;
for(int i=0;i<n;i++){
cin >> word;
for(int j=0;j<13;j++){
if (word[j]=='X') continue;
if (word[j]=='J') {sum = sum + 1; continue;}
if (word[j]=='Q') {sum = sum + 2; continue;}
if (word[j]=='K') {sum = sum + 3; continue;}
if (word[j]=='A') {sum = sum + 4; continue;}
}
}
cout << sum;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
468 KB |
Output is correct |
3 |
Correct |
2 ms |
468 KB |
Output is correct |
4 |
Correct |
2 ms |
468 KB |
Output is correct |
5 |
Correct |
2 ms |
480 KB |
Output is correct |
6 |
Correct |
2 ms |
480 KB |
Output is correct |
7 |
Correct |
2 ms |
492 KB |
Output is correct |
8 |
Correct |
2 ms |
560 KB |
Output is correct |
9 |
Correct |
3 ms |
728 KB |
Output is correct |
10 |
Correct |
3 ms |
732 KB |
Output is correct |