Advertisement
Guest User

Untitled

a guest
Nov 13th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3. #include <fstream>
  4. #include "Structure.h"
  5.  
  6. using namespace std;
  7. Structure structure;
  8.  
  9.  
  10. int main() {
  11.  
  12. char choice = NULL;
  13.  
  14. while (choice != '0') {
  15. if (choice == '0' || choice == '1' || choice == '2' || choice == '3' || choice == '4' || choice == '5' || choice == NULL) {
  16. cout << "\n1. Load data from file\n";
  17. cout << "2. Randomize data\n";
  18. cout << "3. Brute Force\n";
  19. cout << "4. Branch & Bound\n";
  20. cout << "5. Dynamic Programming\n";
  21. cout << "0. Exit\n";
  22. }
  23.  
  24. choice = _getch();
  25. if (choice == 'x00')
  26. choice = _getch();
  27.  
  28. switch (choice) {
  29. case '1':
  30. system("CLS");
  31. cout << endl << "Data has been loaded: \n\n";
  32. structure.read_from_file("tsp_17.txt");
  33. structure.displayStructure();
  34. break;
  35. case '2':
  36. system("CLS");
  37. cout << endl << "Data has been randomized." << endl;
  38. break;
  39. case '3':
  40. system("CLS");
  41. structure.TSP(0);
  42. structure.displayResult();
  43. }
  44.  
  45.  
  46. }
  47.  
  48.  
  49.  
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement