#include #include #include using namespace std; int main() { cout << "How many nights is your trip\n"; int nights {0}; cin >> nights; if (!cin) { cerr << "Invalid number inputted.\n" << "Please input the amount of nights your" << "trip is\n"; } if (nights == 0) { cout << "You will not be staying overnight so no need to bring any toothpaste.\n"; return EXIT_SUCCESS; } int toothpaste {0}; for(int i {1}; i <= nights; ++i) { cout << "For night " << i << ", brush at night " << "and in the morning.\n"; toothpaste += 2; } cout << "You will need enough toothpaste to brush your teeth " << toothpaste << " times.\n"; return EXIT_SUCCESS; }