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
|
#include <iostream>
#include <ctime>
#include <fstream>
#include <string>
using namespace std;
void main ()
{
{
string date1, zip1, direction1, Rate1, Customer1, date2, zip2, direction2, Rate2, Customer2, date3, zip3, direction3, Rate3, Customer3, date4, zip4, direction4, Rate4, Customer4, date5, zip5, direction5, Rate5, Customer5, date6, zip6, direction6, Rate6, Customer6, date7, zip7, direction7, Rate7, Customer7;
ifstream infile;
infile.open ("shipments.txt");
infile >> date1 >> zip1 >> direction1 >> Rate1 >> Customer1 >> date2 >> zip2 >> direction2 >> Rate2 >> Customer2 >> date3 >> zip3 >> direction3 >> Rate3 >> Customer3 >> date4 >> zip4 >> direction4 >> Rate4 >> Customer4 >> date5 >> zip5 >> direction5 >> Rate5 >> Customer5 >> date6 >> zip6 >> direction6 >> Rate6 >> Customer6 >> date7 >> zip7 >> direction7 >> Rate7 >> Customer7;
cout << "Date: " << date1 << endl
<< "Zip: " << zip1 << endl
<< "Direction: " << direction1 << endl
<< "Rate: " << Rate1 << endl
<< "Customer: " << Customer1 << endl
<< endl
<< "Date: " << date2 << endl
<< "Zip: " << zip2 << endl
<< "Direction: " << direction2 << endl
<< "Rate: " << Rate2 << endl
<< "Customer: " << Customer2 << endl
<< endl
<< "Date: " << date3 << endl
<< "Zip: " << zip3 << endl
<< "Direction: " << direction3 << endl
<< "Rate: " << Rate3 << endl
<< "Customer: " << Customer3 << endl
<< endl
<< "Date: " << date4 << endl
<< "Zip: " << zip4 << endl
<< "Direction: " << direction4 << endl
<< "Rate: " << Rate4 << endl
<< "Customer: " << Customer4 << endl
<< endl
<< "Date: " << date5 << endl
<< "Zip: " << zip5 << endl
<< "Direction: " << direction5 << endl
<< "Rate: " << Rate5 << endl
<< "Customer: " << Customer5 << endl
<< endl
<< "Date: " << date6 << endl
<< "Zip: " << zip6 << endl
<< "Direction: " << direction6 << endl
<< "Rate: " << Rate6 << endl
<< "Customer: " << Customer6 << endl
<< endl
<< "Date: " << date7 << endl
<< "Zip: " << zip7 << endl
<< "Direction: " << direction7 << endl
<< "Rate: " << Rate7 << endl
<< "Customer: " << Customer7 << endl;
infile.close();
}
system ("pause");
}
|