-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproject5.cc
49 lines (45 loc) · 1.2 KB
/
project5.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
* @file: project5.cc
*
*@brief:
* Main program for CPS222 project 5 - test driver to read in a graph
* from standard input and test the read graph
*
* @Authors: Elijah Opoku-Nyarko & Jake Colbert
*/
#include <iostream>
#include <string>
#include "./province.h"
using namespace std;
/*
* check if we are at the end of the file
*/
bool eof() {
char c;
std::cin >> c;
// if the fie is ended, return true
if (std::cin.eof()) {
return true;
} else {
// if the file contains more data, return the previously gotten
// data to cin
std::cin.unget();
return false;
}
}
int main(int argc, char *argv[]) {
// Repeatedly read input from standard input
while (!eof()) {
// create a new graph for each loop, which will read all of the
// corresponding data per graph
Province theProvince(cin);
theProvince.printAll(0, cout);
theProvince.printShortestPath(std::cout);
theProvince.minSpan(std::cout);
theProvince.removeBridges(cout);
theProvince.articulationPoints(cout);
std::cout << std::endl;
std::cout << "------------------------------------------------------------------";
cout << endl << endl;
}
}