Advertisement
Josif_tepe

Untitled

Feb 17th, 2024
976
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main() {
  6.     string product;
  7.     cin >> product;
  8.     double cena;
  9.     cin >> cena;
  10.    
  11.     int n;
  12.     cin >> n;
  13.     double danok = 0.18;
  14.     for(int i = 0; i < n; i++) {
  15.         string s;
  16.         cin >> s;
  17.         if(s == product) {
  18.             danok = 0.05;
  19.         }
  20.     }
  21.     cena += (cena * danok);
  22.     printf("%.5lf", cena);
  23.     return 0;
  24.                
  25. }
  26. // NNNNNNNNaN
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement