Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <algorithm>
- #include "histogram.h"
- int main(){
- const char * const strProgramName = "Histogramer 1.0";
- std::cout << std::setfill('*') << std::setw(strlen(strProgramName)+4) << "" << std::endl;
- std::cout << '*' << std::setfill(' ') << std::setw(strlen(strProgramName)+3) << '*' << std::endl;
- std::cout << "* " << strProgramName << " *" << std::endl;
- std::cout << '*' << std::setfill(' ') << std::setw(strlen(strProgramName)+3) << '*' << std::endl;
- std::cout << std::setfill('*') << std::setw(strlen(strProgramName)+4) << "" << std::endl << std::endl;
- Histogram myBarChart;
- InitHistogram(myBarChart);
- AddBlock(myBarChart, "aaa");
- AddBlock(myBarChart, "a");
- AddBlock(myBarChart, "aa");
- AddBlock(myBarChart, "b");
- AddBlock(myBarChart, "c");
- AddBlock(myBarChart, "a");
- AddBlock(myBarChart, "dddddddddddd");
- AddBlock(myBarChart, "e");
- AddBlock(myBarChart, "c");
- AddBlock(myBarChart, "z");
- AddBlock(myBarChart, "zzz");
- AddBlock(myBarChart, "z");
- AddBlock(myBarChart, "z");
- AddBlock(myBarChart, "z");
- AddBlock(myBarChart, "Y");
- AddBlock(myBarChart, "Y");
- AddBlock(myBarChart, "aa");
- AddBlock(myBarChart, "aa");
- AddBlock(myBarChart, "aa");
- AddBlock(myBarChart, "aa");
- PrintHistogram(myBarChart);
- std::cout << std::endl;
- SortByVal(myBarChart);
- PrintHistogram(myBarChart);
- std::cout << std::endl;
- SortByVal(myBarChart, false);
- PrintHistogram(myBarChart);
- DestroyHistogram(myBarChart);
- std::cout << std::endl;
- char* str = "balaklava";
- stringHist(str);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement