Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- double priceOver20kg, bagWeight;
- cin >> priceOver20kg >> bagWeight;
- int dayBefore, bagCount;
- cin >> dayBefore >> bagCount;
- if (bagWeight < 10) {
- priceOver20kg /= 5;
- }
- else if (bagWeight <= 20) {
- priceOver20kg /= 2;
- }
- if (dayBefore < 7) {
- priceOver20kg *= 1.4;
- }
- else if (dayBefore <= 30) {
- priceOver20kg *= 1.15;
- }
- else if (dayBefore > 30){
- priceOver20kg *= 1.1;
- }
- double total = priceOver20kg * bagCount;
- printf("The total price of bags is: %.2f lv.\n", total);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement