vlatkovski

DDV

Aug 24th, 2016
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <iomanip>
  4. #include <vector>
  5.  
  6. using namespace std;
  7.  
  8. int main() {
  9.     string ime;
  10.     double c;
  11.     int n;
  12.     cin >> ime >> c >> n;
  13.  
  14.     vector<string> ddv5;
  15.     for (int i = 0; i < n; i++) {
  16.         string x;
  17.         cin >> x;
  18.         ddv5.push_back(x);
  19.     }
  20.  
  21.     bool ddv18 = true;
  22.  
  23.     for (unsigned int i = 0; i < (unsigned)n; i++) {
  24.         if (ddv5[i] == ime) {
  25.             ddv18 = false;
  26.             break;
  27.         }
  28.     }
  29.  
  30.     double cena = ddv18 ? c * 1.18 : c * 1.05;
  31.  
  32.     cout << setprecision(5) << fixed << cena << endl;
  33.  
  34.     return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment