Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- using namespace std;
- int main()
- {
- string array[][4]={
- {"Name","Address","City","State",},
- {"Bantam Books","666 Fifth Ave","New York","NY",},
- {"ETN Corporation ","Rd 4, Box 659","Detroit","MI",},
- {"Benjamin/Cummings","390 Bridge Pkwy","Redwood","CA",},
- {"Intertext","2633 E.17th Ave","New York","NY",},
- {"Addison Wesley","Rte 128","Reading","MA",},
- {"Brady Pub","15 Columbus Cir","New York","NY",},
- {"Gale","835 Penobscot","Redwood","CA",},
- {"ACM","11W. 42nd St.","New York","NY",}
- };
- for(int row=0;row<9;row++)
- {
- for(int col=0;col<4;col++)
- {
- cout<<left<<setw(20)<<array[row][col];
- }
- cout<<endl;
- }
- cout<<endl;
- cout<<left<<setw(20)<<array[0][0]<<setw(20)<<array[0][1]<<setw(20)<<array[0][2]<<array[0][3]<<endl;
- 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;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement