summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Guschin <saintruler@gmail.com>2021-03-29 13:13:40 +0400
committerAndrew Guschin <saintruler@gmail.com>2021-03-29 13:13:40 +0400
commit85dcaa072faeadc318ec717caa29d1cb94bddd59 (patch)
treed2cfc0f4b8b00a80ab87afade371f63a7ce4b193
parent5a5e997ce29416cc971548d2efeb6b834c96d237 (diff)
Исправил и переименовал первые три задачи
-rw-r--r--graphs/Makefile36
-rw-r--r--graphs/task1.cpp (renamed from graphs/task1_1.cpp)3
-rw-r--r--graphs/task2.cpp (renamed from graphs/task12_1.cpp)3
-rw-r--r--graphs/task3.cpp (renamed from graphs/task9_1.cpp)0
4 files changed, 20 insertions, 22 deletions
diff --git a/graphs/Makefile b/graphs/Makefile
index 1441a5f..11c6460 100644
--- a/graphs/Makefile
+++ b/graphs/Makefile
@@ -2,31 +2,31 @@ CXX=g++
CFLAGS=-g -Wall
COMPILE=$(CXX) $(CFLAGS)
-task1_1:
- $(COMPILE) -o task.out task1_1.cpp
-test1_1: task1_1
+task1:
+ $(COMPILE) -o task.out task1.cpp
+test1: task1
@printf "4\n5\n1 2\n1 3\n1 4\n2 3\n3 4\n1" | ./task.out
@printf "Answer: 3\n"
@printf "4\n5\n1 2\n1 3\n1 4\n2 3\n3 4\n2" | ./task.out
- @printf "Answer: 2\n"
+ @printf "Answer: 1\n"
@printf "4\n5\n1 2\n1 3\n1 4\n2 3\n3 4\n3" | ./task.out
- @printf "Answer: 3\n"
+ @printf "Answer: 1\n"
@printf "4\n5\n1 2\n1 3\n1 4\n2 3\n3 4\n4" | ./task.out
- @printf "Answer: 2\n"
+ @printf "Answer: 0\n"
-task12_1:
- $(COMPILE) -o task.out task12_1.cpp
-test12_1: task12_1
+task2:
+ $(COMPILE) -o task.out task2.cpp
+test2: task2
@printf "4\n5\n1 2\n1 3\n1 4\n2 3\n3 4\n4 2" | ./task.out
-task9_1:
- $(COMPILE) -o task.out task9_1.cpp
-test9_1: task9_1
+task3:
+ $(COMPILE) -o task.out task3.cpp
+test3: task3
@printf "4\n5\n1 2\n1 3\n1 4\n2 3\n3 4" | ./task.out
-task5_2:
- $(COMPILE) -o task.out task5_2.cpp
-test5_2: task5_2
+task4:
+ $(COMPILE) -o task.out task4.cpp
+test4: task4
@printf "" | ./task.out
@printf "Answer: \n"
@@ -36,9 +36,9 @@ test5: task5
@printf "" | ./task.out
@printf "Answer: \n"
-task7_2:
- $(COMPILE) -o task.out task7_2.cpp
-test7_2: task7_2
+task6:
+ $(COMPILE) -o task.out task6.cpp
+test6: task6
@printf "" | ./task.out
@printf "Answer: \n"
diff --git a/graphs/task1_1.cpp b/graphs/task1.cpp
index 140c1bd..62806ae 100644
--- a/graphs/task1_1.cpp
+++ b/graphs/task1.cpp
@@ -34,7 +34,7 @@ int main()
cout << "o----------------------o" << endl;
- cout << "Введите рёбра (неориентированные):" << endl;
+ cout << "Введите рёбра (ориентированные):" << endl;
for (int i = 0; i < k; ++i)
{
int a, b;
@@ -42,7 +42,6 @@ int main()
a--;
b--;
g[a].push_back(b);
- g[b].push_back(a);
}
cout << "Введённый граф:" << endl;
diff --git a/graphs/task12_1.cpp b/graphs/task2.cpp
index 380d5ac..17dcdbe 100644
--- a/graphs/task12_1.cpp
+++ b/graphs/task2.cpp
@@ -33,7 +33,7 @@ int main()
cout << "| Нумерация вершин с 1 |" << endl;
cout << "o----------------------o" << endl;
- cout << "Введите рёбра (неориентированные):" << endl;
+ cout << "Введите рёбра (ориентированные):" << endl;
for (int i = 0; i < k; ++i)
{
int a, b;
@@ -41,7 +41,6 @@ int main()
a--;
b--;
g[a].push_back(b);
- g[b].push_back(a);
}
cout << "Введённый граф:" << endl;
diff --git a/graphs/task9_1.cpp b/graphs/task3.cpp
index 01f3307..01f3307 100644
--- a/graphs/task9_1.cpp
+++ b/graphs/task3.cpp