Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- string fuel;
- cin >> fuel;
- double liters;
- cin >> liters;
- fuel[0] = tolower(fuel[0]);
- if (fuel == "diesel" || fuel == "gasoline" || fuel == "gas") {
- if (liters >= 25) {
- cout << "You have enough " << fuel << "." << endl;
- }
- else {
- cout << "Fill your tank with " << fuel << "!" << endl;
- }
- }
- else {
- cout << "Invalid fuel!" << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement