Q:

Making code more efficient by reducing if statements

I'm making a recipe dispenser program that will print recipes based on:

The spice level of the food
The time it takes to cook

I may add more later down the road.
#include <iostream>
#include <string>
using namespace std;

int main()
{
    string input = "";
    string recipe1 = "A mild recipe that takes 10 mins";
    string recipe2 = "A mild recipe that takes 20 mins";
    string recipe3 = "A medium recipe that takes 10 mins";
    string recipe4 = "a mild recipe that takes 20 mins";

    cout << "Hello to the recipe dispenser 2000" << endl << "I will now begin with some questions to get the perfect recipe for you" << endl << "Do you like your food mild, medium, or hot?" << endl;
    getline (cin, input);
    if(input == "mild")
      cout << "Would you like a recipe that takes 10 or 20 mins?" << endl;
      getline (cin, input);
      if(input == "10" or input == "10 mins")
        cout << recipe1 << endl;
}

However the code I have now seems pretty inefficient, as I would have to write out a total of 6 if statements in order to complete the code.
Is there any way to shorten this?
For example by adding some tags or something to each recipe, like [10, mild] to recipe1, then the code will output the response based on the tags.
Any ideas are appreciated. 

A:

int main()
{
    string input = "";
    int inp;
    map< string,map<int,string> > recipe;
    recipe["mild"][10]="A mild recipe that takes 10 mins";
    recipe["mild"][20]= "A mild recipe that takes 20 mins";
    recipe["medium"][10]= "A medium recipe that takes 10 mins";

    cout << "Hello to the recipe dispenser 2000" << endl << "I will now begin with some questions to get the perfect recipe for you" << endl << "Do you like your food mild, medium, or hot?" << endl;
    getline (cin, input);
    cout << "Would you like a recipe that takes 10 or 20 mins?" << endl;
    cin>>inp;
    try
    {
        cout<<(recipe.at(input)).at(inp);
    }
    catch(exception &e)
    {
        cerr<<input<<" , "<<inp<<" has not been invented yet!\n";
    }
    return 0;
}

Pretty elegant use of STL in my opinion. Hope this serves your purpose.
Refer 

For maps : http://www.cplusplus.com/reference/map/
And http://www.cprogramming.com/tutorial/stl/stlmap.html
For try catch : http://www.cplusplus.com/doc/tutorial/exceptions/

