Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int a, b, c;
- cin >> a >> b >> c;
- int k;
- cin >> k;
- long long res = 1;
- string s;
- for(int i=0; i<k; i++)
- {
- cin >> s;
- if(s == "Blue")
- res*=a;
- else if(s == "Red")
- res*=b;
- else
- res*=c;
- }
- cout << res << endl;
- return 0;
- }
Add Comment
Please, Sign In to add comment