Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int days, hours;
- cin >> days >> hours;
- double totalPrice = 0;
- for (int i = 1; i <= days; i++) {
- double dayPrice = 0;
- for (int j = 1; j <= hours; j++) {
- if (i % 2 == 0 && j % 2 == 1) {
- dayPrice += 2.50;
- }
- else if (i % 2 == 1 && j % 2 == 0) {
- dayPrice += 1.25;
- }
- else {
- dayPrice++;
- }
- }
- totalPrice += dayPrice;
- printf("Day: %i - %.2f leva\n", i, dayPrice);
- }
- printf("Total: %.2f leva\n", totalPrice);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement