From d855055e10f28f021dec1969e436426f8c3b1cef Mon Sep 17 00:00:00 2001 From: Fennel Kora <99110900+fencore@users.noreply.github.com> Date: Wed, 26 Jul 2023 00:40:51 -0400 Subject: [PATCH] Added routine to capture edge inputs and break into substrings --- Project12/Project12.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Project12/Project12.cpp b/Project12/Project12.cpp index bb4eed8..affe6f3 100644 --- a/Project12/Project12.cpp +++ b/Project12/Project12.cpp @@ -31,14 +31,33 @@ Notes #include #include "digraph.h" +#include +#include + +using namespace std; int main() { int nodes; + string edgeInput; cout << "How many nodes will the digraph have?\nEnter number of nodes: "; cin >> nodes; vector> relations; + cout << "\nEnter the node connections in the format \"X-Y\" where\n" + << "X is the source node and Y is the destination node\n"; + cout << "Valid nodes range from 0 to " << nodes << " inclusive.\n" + << "Enter \'q\' to stop edge entry.\n"; + + while (edgeInput != "q") { + cout << "\nEdge: "; + cin >> edgeInput; + string a, b; + stringstream ss(edgeInput); + getline(ss, a, '-'); + getline(ss, b, '-'); + + } } \ No newline at end of file