Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using std::cout;
- using std::cin;
- int main()
- {
- int lineAmount, discountCategory, i = 0, price, category, amount;
- float discount, summary = 0;
- cin >> lineAmount >> discountCategory >> discount;
- for (; i < lineAmount; i++)
- {
- cin >> price >> category >> amount;
- summary += (category == discountCategory ? price - price * discount : price) * amount;
- }
- cout << static_cast<int>(summary);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement