GastonFontenla

Timus: 1573 - Alchemy

Jun 5th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int a, b, c;
  8.     cin >> a >> b >> c;
  9.     int k;
  10.     cin >> k;
  11.  
  12.     long long res = 1;
  13.     string s;
  14.  
  15.     for(int i=0; i<k; i++)
  16.     {
  17.         cin >> s;
  18.         if(s == "Blue")
  19.             res*=a;
  20.         else if(s == "Red")
  21.             res*=b;
  22.         else
  23.             res*=c;
  24.     }
  25.  
  26.     cout << res << endl;
  27.  
  28.     return 0;
  29. }
Add Comment
Please, Sign In to add comment