Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdio.h>
- using namespace std;
- int main()
- {
- int a[52], N, sum = 0;
- char b[52];
- string s;
- cin >> N;
- for (int i = 0; i < N; i++) {
- cin >> b[i] >> a[i] >> a[i+26];
- b[i+26] = b[i] - 32;
- }
- cin >> s;
- for (int i = 0; i < s.length(); i++) {
- for (int k = 0; k < 52; k++) {
- if (s[i] == b[k]) sum+=a[k];
- }
- }
- cout << sum;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement