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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
#include <iostream>
#include <iomanip>
#include <cmath>
#include <fstream>
#include <string>
using namespace std;
struct company
{
int n, n1, n2, n3;
int s, s1, s2, s3;
int e, e1, e2, e3;
int w, w1, w2, w3;
};
void getData(company&);
void dispDivInfo(company);
int main()
{
company branch1;
getData(branch1);
dispDivInfo(branch1);
/*getData(branch2);
dispDivInfo(branch2);*/
/*getData(branch3);
dispDivInfo(branch3);
getData(branch4);
dispDivInfo(branch4);*/
return 0;
}
void getData(company &amount)
{
ifstream myfile("quarterlysalesfigures.txt");
int n, n1, n2, n3; int s, s1, s2, s3; int e, e1, e2, e3; int w, w1, w2, w3;
myfile.open("quarterlysalesfigures.txt");
myfile >> n >> n1 >> n2 >> n3 >> s >> s1 >> s2 >> s3
>> e >> e1 >> e2 >> e3 >> w >> w1 >> w2 >> w3;
myfile.close();
}
void dispDivInfo(company amount)
{
cout << "For the North is " << amount.n << amount.n1 << amount.n2 << amount.n3 << endl;
cout << "For the South is " << amount.s << amount.s1 << amount.s2 << amount.s3 << endl;
cout << "For the East is " << amount.e << amount.e1 << amount.e2 << amount.e3 << endl;
cout << "For the West is " << amount.w << amount.w1 <<amount.w2 << amount.w3 << endl;
}
| |