Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- #include <iomanip>
- using namespace std;
- int main() {
- double needed_hours;
- double days;
- double overtime_workers;
- cin >> needed_hours >> days >> overtime_workers;
- double real_days = days * 0.9;
- double working_hours = floor(real_days * 8);
- double overtime = overtime_workers * 2 * days;
- double total_working_hours = working_hours + overtime;
- if (total_working_hours >= needed_hours)
- {
- double left_hours = total_working_hours - needed_hours;
- cout << "Yes!" << left_hours << " hours left." << endl;
- }
- else
- {
- double insufficient_hours = needed_hours - total_working_hours;
- cout << "Not enough time!" << insufficient_hours << " hours needed." << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement