diff options
[SDP/P/exb] Solved exercise B
1 files changed, 19 insertions, 0 deletions
| -rw-r--r-- | Year 2/Structures and data algorithms/Project/exb/main.cpp | 19 |
diff --git a/Year 2/Structures and data algorithms/Project/exb/main.cpp b/Year 2/Structures and data algorithms/Project/exb/main.cpp new file mode 100644 index 0000000..118c79b --- /dev/null +++ b/Year 2/Structures and data algorithms/Project/exb/main.cpp @@ -0,0 +1,19 @@ +#include "CityVisit.h" +#include <iostream> + +int main() { + std::cout << "Име на град: "; + std::string fileName; + std::cin >> fileName; + + std::ifstream inFile(fileName + ".txt"); + if (!inFile.is_open()) + throw std::logic_error("The given city has no .txt file!"); + + CityVisit cv; + std::deque<std::string> visited = cv.visitTheMostInTime(inFile); + inFile.close(); + for (std::string v : visited) + std::cout << v << " "; + std::cout << std::endl; +} |
