-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnested5.20.cpp
More file actions
40 lines (33 loc) · 757 Bytes
/
nested5.20.cpp
File metadata and controls
40 lines (33 loc) · 757 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <iostream>
const int Cities = 5;
const int Years = 4;
int main()
{
using namespace std;
const char* cities[Cities] =
{
"Gribble City",
"Gribbletown",
"New Gribble",
"San Gribble",
"Gribble Vista"
};
int maxtemps[Years][Cities] =
{
{96, 100, 87, 101, 105},
{96, 98, 91, 107, 104},
{97, 101, 93, 108, 107},
{98, 103, 95, 109, 108}
};
cout << "Maximum temperatures for 2008 - 2001\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 << endl;
}
return 0;
}