Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main()
- {
- ifstream in("in.txt");
- ofstream out("out.txt");
- int i;
- in >> i;
- vector<vector<double>> matrix(i, vector<double>(i, 0));
- int a, b;
- double w;
- while (in >> a >> b >> w)
- {
- matrix[a-1][b-1] = w;
- }
- out << fixed << setprecision(1);
- for (int x = 0; x < matrix.size(); x++)
- {
- for (int y = 0; y < matrix.size(); y++)
- out << matrix[x][y] << '\t';
- out << endl;
- }
- marks.assign(i, false);
- dfs(0, matrix);
- for (int z = 0; z < marks.size(); z++)
- out << marks[z] << '\t';
- out << endl;
- // Нерабочий код
- /*
- marks.assign(i, false);
- bfs(0, matrix);
- for (int z = 0; z < marks.size(); z++)
- out << marks[z] << '\t';
- out << endl;
- */
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement