Server IP : 172.16.15.8 / Your IP : 18.119.133.138 Web Server : Apache System : Linux zeus.vwu.edu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Wed Nov 6 14:29:02 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.2.24 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0705) : /home/acyurksaitis/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
// CS212 HW #7: hw7.cpp // // Due: April 9, 2008 // // Author: Amy Yurksaitis // // Instructor: Dr. Wang // // Goal: This program will allow the user to insert a string to the vector, // delete the last string, sort the vector to ascending order, sort it // to descending order, print the number of the strings in the vector, // reverse the order in the vector, empty the vector. // // Compile: g++ hw7 .cpp -o hw7.out // Run: ./hw7.out ////////////////////////////////////////////////////////////////////////////////////////// #include <iostream> #include <vector> #include <algorithm> #include "hw7.h" using namespace std; void print( const vector<string>& ); void print_backwards( const vector<string> &); void print_backwards( const vector<string> &a) { for(int i=a.size()-1; i>=0; --i) cout << a[i] << " "; cout << endl; cout << "----------------"<<endl; } void print( const vector<string>& a) { for(int i=0; i<a.size(); ++i) cout << a[i] << " "; cout << endl; cout << "----------------"<<endl; }