Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "library.h"
- #include <iostream>
- using namespace std;
- int main()
- {
- ifstream input("input.txt");
- ofstream output("output.txt");
- List A;
- A.Read(input);
- A.Print(output);
- List B;
- Point* curPoint = A.getStart();
- int n = A.GetLast();
- while (curPoint != nullptr) {
- B.addPoint();
- AdjPoint* curAdjPoint = curPoint->First;
- for (int i = 1; i <= n; i++) {
- if (curAdjPoint == nullptr) {
- if (i != curPoint->number)
- B.addAdjPoint(i);
- }
- else if (curAdjPoint->value != i) {
- if (i != curPoint->number)
- B.addAdjPoint(i);
- }
- else curAdjPoint = curAdjPoint->next;
- }
- curPoint = curPoint->NextPoint;
- }
- output << "result: " << endl;
- B.Print(output);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement