Advertisement
KeeganT

Ass69

Oct 15th, 2017
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.98 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     string array[][4]={
  9.     {"Name","Address","City","State",},
  10.     {"Bantam Books","666 Fifth Ave","New York","NY",},
  11.     {"ETN Corporation ","Rd 4, Box 659","Detroit","MI",},
  12.     {"Benjamin/Cummings","390 Bridge Pkwy","Redwood","CA",},
  13.     {"Intertext","2633 E.17th Ave","New York","NY",},
  14.     {"Addison Wesley","Rte 128","Reading","MA",},
  15.     {"Brady Pub","15 Columbus Cir","New York","NY",},
  16.     {"Gale","835 Penobscot","Redwood","CA",},
  17.     {"ACM","11W. 42nd St.","New York","NY",}
  18.     };
  19.  
  20.     for(int row=0;row<9;row++)
  21.     {
  22.         for(int col=0;col<4;col++)
  23.         {
  24.             cout<<left<<setw(20)<<array[row][col];
  25.         }
  26.         cout<<endl;
  27.     }
  28.     cout<<endl;
  29.     cout<<left<<setw(20)<<array[0][0]<<setw(20)<<array[0][1]<<setw(20)<<array[0][2]<<array[0][3]<<endl;
  30.     for(int c=0;c<9;c++)if(array[c][2]=="New York")cout<<left<<setw(20)<<array[c][0]<<setw(20)<<array[c][1]<<setw(20)<<array[c][2]<<array[c][3]<<endl;
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement