utput == 'r'); break; SOME_ACTIONS_MODE: successfulInput = (output == 'p' | | output == 'm' | | output == 's' | | output == 'r' ); break;
}
} while (! successfulInput);
} _input (string & var) {. sync (); (cin, var);
} fileExists (string fileName) {(ifstream (fileName)! = NULL);
} main () {(LC_ALL, "Russian"); ("cls"); DirectedGraph * firstArc, * sideNode; ostream * out; fstream fileForOutput; string fileForOutputName; short CURRENT_STAGE = 0 ; int vertexWithMaxLevel, maxLevel, NUM_VERTEX = 0; bool ** adjacencyMatrix, fileOutput; char action; static short START_EXECUTION = 0, INPUT_DATA = 1, THE_MAIN_PART = 2, SOME_ACTIONS_PERFORMED = 3; static char ASK_MODE = 'b', MAIN_MODE = 'm ', SOME_ACTIONS_MODE =' s ', =' y ', NO =' n ', _THE_SCREEN =' s ', INTO_A_FILE =' f ', _INPUT =' i ', FOR_OUTPUT =' o ', FOR_APPEND =' a ', _NEIBORHOODS = 'p', MAKE_ADJACENCY_MATRIX = 'm', DELETE_VERTEX = 'd', RESTART_PROGRAM = 'r', SAVE_NEW_GRAPH = 's', EXIT = 'e'; * assembleGraph (int & NUM_VERTEX, ostream * stream); openFile ( string fileName, char mode); findVertexAndPrintNewList (DirectedGraph * firstNode, int NUM_VERTEX, int & maxLevel, ostream * stream); ** completeAdjacencyMatrix (DirectedGraph * firstNode, int NUM_VERTEX); saveGraph (string fileName, DirectedGraph * firstNode, int NUM_VERTEX) ; removeAdjacentVertex (DirectedGraph * & firstArc, int NUM_VERTEX, int vertexId, int vertexLevel); removeNode (DirectedGraph * node, DirectedGraph * & firstNode); printNeiborhoodsList (DirectedGraph * firstNode, ostream * stream, int NUM_VERTEX, bool saveMode, string title = ""); printMatrix (bool ** matrix, int dimension, ostream * stream, string title = ""); clearMatrix (bool ** matrix, int dimention); (CURRENT_STAGE) {START_EXECUTION:
cout <<"Режим введення даних (f - у файл, s - на екран, e - вихід):";
_input (action, FOR_OUTPUT); (action) {ON_THE_SCREEN: = &cout; = false;; INTO_A_FILE:
cout <<"Файл для запису (розширення не потрібно):";
} _STAGE = INPUT_DATA;; INPUT_DATA: = assembleGraph (NUM_VERTEX, out); _STAGE = THE_MAIN_PART;; THE_MAIN_PART:
cout <<"Список доступних дій:" <