I 1
IV 4
etc.
and i need to give user option to sort them by roman numeral or numbers but im jsut completely lost now
const int counters = 1000;
void bubbles(vector
int main()
{
bool swap;
int temp;
int count = 0;
vector
string line;
cout << "Testing loading of file." << endl;
system("pause");
ifstream myfile("sorting.txt");
if (myfile.is_open())
{
while (!myfile.eof())
{
getline(myfile, line);
logs.push_back(line);
count++;
}
myfile.close();
}
else{
cout << "Unable to open file." << endl;
}
cout << "the log count is: " << count << endl;
bubbles(logs);
return 0;
}
void bubbles(vector
{
bool swap = false;
string temp;
do
{
swap = false;
for (int count = 0; count < (logs.size() - 1); count++)
{
if (logs.at(count) > logs.at(count +1))
{
temp = logs.at(count);
logs.at(count) = logs.at(count+ 1);
logs.at(count+1) = temp;
swap = true;
cout << logs.at(count) << " " << logs.at(count + 1) << endl;
}
}
} while (swap);
}