lab5 - } for (int i=0; i !=n; i++){ if ((i%2)==0){...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
#include <vector> #include <iostream> #include <string> # using namespace std; u int main() { vector<string> names; int n; int SetNum=1; string name; cin >> n; while (n != 0){ for (int i=0; i !=n; i++){ cin >> name; names.insert(i, name);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } for (int i=0; i !=n; i++){ if ((i%2)==0){ cout<< names[i] << endl; } } for (int i=n; i != 0; i--){ if ((i%2)!=0){ cout<< names[i] << endl; } } SetNum++; cin>> n; } }...
View Full Document

This note was uploaded on 05/03/2011 for the course CSCI 180 taught by Professor Goldwasser,m during the Fall '08 term at Saint Louis.

Ask a homework question - tutors are online