-
Vote Now Please :)
This is a vote for the best code for CONTEST #1 found
on this page, you should vote on the code that
looks the ebst and follows all the requirements,
thanks ahead of time for your participation.
Winner of Contest #2 and #3 and the rule for Contest #1
can be found here :
http://cboard.cprogramming.com/showt...9&page=1&pp=15
THE POLL WILL CLOSE IN 5 DAYS
-
-
Nice job Hunter2, your code is infact the shortest and it works great. Although as I read in your other post you forgot capitals, but still its a nice implementation I must say.
Lol saw gators and it had numbers so I was thinking wow not going to vote for him, but then realized it was a different program... But I chose hunter2 because his is the shortest and it accomplishes the task.
Sorry I think its weird to have people vote on programs that are different in nature, but thats just my opinion.
-
Ah that was a mistake on my part, i posted the wrong code.
Gogators is not in the running of this competition.
Sorry about that.
-
while brain's handles errors and such more elegantly, I must say that Hunter2's code is much more straightforward and to the point...
and on the topic of gogator's code, what about this:
Code:
#include <vector>
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
void makeVector(string line, vector <string> &Adjust);
int main(void){
vector <string> Storage;
string infileName,outfileName, fileLine;
fstream input_file, output_file;
cout << "Enter the filename to read in: ";
cin >> infileName;
input_file.open(infileName.c_str(),ios::in);
cout << endl << "Enter the filename to read out to: ";
cin.ignore(80,'\n');
getline(cin, outfileName);
output_file.open(outfileName.c_str(), ios::out);
if(!input_file.fail()){
while(getline(input_file, fileLine)){
makeVector(fileLine, Storage);
}
for(int i=0; i<Storage.size(); i++) output_file << Storage[i] << endl;
}
return 0;
}
void makeVector(string line, vector <string> &Adjust){
string vowels = "aeiouyAEIOUY", tempLine = line;
for(int i=0; i<line.length(); i++){
for(int j=0; j<vowels.length(); j++){
if(line[i] == vowels[j]){
int line_diff = line.length()-tempLine.length();
Adjust.push_back(line.substr(line_diff,i-line_diff));
tempLine = line.substr(i,line.length());
}
}
}
Adjust.push_back(tempLine);
}
(sorry gogator if you didn't want that reposted - PM me and I'll edit it out)