Advertisement
patryk

Untitled

Apr 19th, 2014
338
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. #include<iostream>
  2. #include<stdio.h>
  3. #include<conio.h>
  4. #include<windows.h>
  5. #include<fstream>
  6. #include<time.h>
  7.  
  8. using namespace std;
  9.  
  10. vector<vector<int>> graph;
  11.  
  12. void Macierz_Sasiedztwa_Add(vector<vector<int>> &graph, int x, int y){
  13.     graph[x][y] = 1;
  14.     graph[y][x] = 1;
  15. }
  16.  
  17. int Macierz_Sasiedztwa_Check(int x, int y){
  18.     if(graph[x][y] == 1)
  19.         return 1;
  20. }
  21.  
  22.  
  23. int main()
  24. {    
  25.     fstream plik;
  26.     plik.open("dane.txt", ios::in);
  27.     if(plik.good() == true){
  28.         plik >> x;
  29.         plik >> y;
  30.         Macierz_Sasiedztwa_Add();
  31.     }
  32.     plik.close();
  33.     getch();
  34.     return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement