Advertisement
kadeyrov

Untitled

Aug 23rd, 2020
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.75 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <algorithm>
  4. #include <vector>
  5. #include <string>
  6. #include <set>
  7.  
  8. using namespace std;
  9.  
  10. int main () {
  11.     int n, ans = 0;
  12.     cin >> n;
  13.    
  14.     while (n--) {
  15.         string s;
  16.         cin >> s;
  17.        
  18.         switch (s[0]) {
  19.             case 'T':
  20.                 ans += 4;
  21.                 break;
  22.             case 'C':
  23.                 ans += 6;
  24.                 break;
  25.                
  26.             case 'O':
  27.                 ans += 8;
  28.                 break;
  29.                    
  30.             case 'D':
  31.                 ans += 12;
  32.                 break;
  33.             case 'I':
  34.                 ans += 20;
  35.                 break;
  36.         }
  37.     }
  38.    
  39.     cout << ans << endl;
  40.    
  41. }
  42.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement