Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.55 KB | None | 0 0
  1. void printReverseResults(map<string, long long int>& sizeMap, map<string, int>& fileCountMap) {
  2.     vector <string> typeVector;
  3.     vector <long long int> sizeVector;
  4.     vector <int> amountVector;
  5.     int fileTypeCount = 0;
  6.     int fileCount = 0;
  7.     long long int fileSizeCount = 0;
  8.     for (auto a = fileCountMap.begin(); a != fileCountMap.end(); a++) {
  9.         typeVector.push_back(a->first);
  10.         amountVector.push_back(a->second);
  11.     }
  12.     for (auto b = sizeMap.begin(); b != sizeMap.end(); b++) {
  13.         sizeVector.push_back(b->second);
  14.     }
  15.     cout << right << setw(40) << "Ext" << right << setw(2) << ":" << right << setw(10) << "#" << right << setw(2) << ":" << right << setw(20) << "Total" << endl;
  16.     cout << setfill('-') << right << setw(40) << "---" << right << setw(2) << ":" << right << setw(10) << "---" << right << setw(2) << ":" << right << setw(20) << "-----" << endl;
  17.  
  18.     for (unsigned c = typeVector.size() - 1; c != -1; c--) {
  19.         fileTypeCount++;
  20.         fileCount += amountVector[c];
  21.         fileSizeCount += sizeVector[c];
  22.  
  23.         cout << setfill(' ') << right << setw(40) << typeVector[c] << right << setw(2) << ":" << right << setw(10) << amountVector[c] << right << setw(2) << ":" << right << setw(20) << sizeVector[c] << endl;
  24.     }
  25.     cout << setfill('-') << right << setw(40) << "---" << right << setw(2) << ":" << right << setw(10) << "---" << right << setw(2) << ":" << right << setw(20) << "-----" << endl;
  26.     cout << setfill(' ') << right << setw(40) << fileTypeCount << right << setw(2) << ":" << right << setw(10) << fileCount << right << setw(2) << ":" << right << setw(20) << fileSizeCount << endl;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement