-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path5_9_6.cpp
More file actions
44 lines (44 loc) · 784 Bytes
/
5_9_6.cpp
File metadata and controls
44 lines (44 loc) · 784 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
41
42
43
44
#include<iostream>
#include<string>
int main()
{
using namespace std;
string month[12] = {
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
};
int sales[3][12];
int sum[3];
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 12; j++)
{
cout << "Please enter the sales volume of " << month[j] << " of year"<<i<<":";
cin >> sales[i][j];
sum[i] = sum[i] + sales[i][j];
}
}
int sum_all = sum[0] + sum[1] + sum[2];
cout << "month";
for (int i = 0; i < 12; i++)
cout << "\t" << month[i];
for (int i = 0; i < 3; i++)
{
cout << endl << "year"<<i<<"\t";
for (int j = 0; j < 12; j++)
cout << sales[i][j] << "\t";
cout << endl;
}
system("pause");
return 0;
}