cout << "Table" << endl;
cout << setw(15) << setiosflags(ios::left) << "Name";
cout << setw(15) << setiosflags(ios::left) << "City";
cout << setw(10) << setiosflags(ios::left) << "Age" << endl;
string names[] = {"lady gaga","luna maya","aura kasih","barack obama"};
string cities[] = {"new york","denpasar","jakarta","white house"};
int ages[] = {24, 27, 25, 50};
cout << "===================================" << endl;
for(int i=0;i<4;i++){
cout << setw(15) << setiosflags(ios::left) << names[i];
cout << setw(15) << setiosflags(ios::left) << cities[i];
cout << setw(10) << setiosflags(ios::left) << ages[i] << endl;
}
cout << setw(15) << setiosflags(ios::left) << "Name";
cout << setw(15) << setiosflags(ios::left) << "City";
cout << setw(10) << setiosflags(ios::left) << "Age" << endl;
string names[] = {"lady gaga","luna maya","aura kasih","barack obama"};
string cities[] = {"new york","denpasar","jakarta","white house"};
int ages[] = {24, 27, 25, 50};
cout << "===================================" << endl;
for(int i=0;i<4;i++){
cout << setw(15) << setiosflags(ios::left) << names[i];
cout << setw(15) << setiosflags(ios::left) << cities[i];
cout << setw(10) << setiosflags(ios::left) << ages[i] << endl;
}
No comments:
Post a Comment