Advertisement
Guest User

Untitled

a guest
Aug 17th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. 4
  2. 5
  3. 1 2
  4. 2 4
  5. 3 1
  6. 3 4
  7. 4 2
  8.  
  9. const graphsMain = () => {
  10.  
  11. let lineReader = require('readline').createInterface({
  12. input: require('fs').createReadStream('file.in')
  13. });
  14.  
  15. lineReader.on('line', function (line) {
  16. console.log('Line from file:', line);
  17. });
  18. }
  19.  
  20. graphsMain();
  21.  
  22. #include <iostream>
  23.  
  24. using namespace std;
  25.  
  26. bool A[10][10];
  27.  
  28. int main() {
  29. int x, y, nodes, edges;
  30. cin >> nodes; // Number of nodes
  31. cin >> edges; // Number of edges
  32. for (int i = 0; i < edges; ++i) {
  33. cin >> x >> y;
  34. A[x][y] = true;
  35. }
  36.  
  37. return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement