// nested.cpp -- nested loops and 2-D array
#include <iostream>
using namespace std;
const int Cities = 5;
const int Years = 4;
int main()
{
    const char * cities[Cities] =   // array of pointers
    {                               // to 5 strings
        "Gribble City",
        "Gribbleton",
        "New Gribble",
        "San Gribble",
        "Gribble Vista"
    };

    int maxtemps[Years][Cities] =   // 2-D array
    {
        {94, 98, 87, 103, 101}, // values for maxtemps[0]
        {98, 99, 91, 107, 105}, // values for maxtemps[1]
        {93, 91, 90, 101, 104}, // values for maxtemps[2]
        {95, 100, 88, 105, 103} // values for maxtemps[3]
    };

    cout << "Maximum temperatures for 1995 - 1998\n\n";

    for (int city = 0; city < Cities; city++)
    {
        cout << cities[city] << ":\t";
        for (int year = 0; year < Years; year++)
            cout << maxtemps[year][city] << "\t";
        cout << "\n";
    }

    return 0;
}

