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 total = 0;
- for (int day = 1; day <= days; day++) {
- double sum = 0;
- for (int hour = 1; hour <= hours; hour++) {
- if (day % 2 == 0 && hour % 2 == 1) {
- sum += 2.50;
- }
- else if (day % 2 == 1 && hour % 2 == 0) {
- sum += 1.25;
- }
- else {
- sum++;
- }
- }
- printf("Day: %i - %.2f leva", day, sum);
- total += sum;
- }
- printf("Total: %.2f leva", total);
- return 0;
- }
Advertisement
Comments
-
- thana-897187482960019be441e987c9e1b56
-
- ADMIN-897187482960019af3920d7577f15d1
-
- ADMIN-897187482960019af3920d7577f15d1
-
- ADMIN-897187482960019af3920d7577f15d1
-
- ADMIN-897187482960019af3920d7577f15d1
Add Comment
Please, Sign In to add comment
Advertisement