Advertisement
Guest User

Untitled

a guest
Jan 17th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int a[101][101], n, m, i, j, c = 0, ok = 0;
  6. void citgr();
  7. int main()
  8. {
  9. citgr();
  10. for ( j = 1; j <= n; j++ )
  11. for ( i = 1; i <= n; i++ )
  12. a[0][j] += a[i][j];
  13. for ( i = 1; i <= n; i++ )
  14. {
  15. if ( a[0][i] == 0 )
  16. {
  17. ok = 1;
  18. cout<< i << " ";
  19. }
  20. }
  21. if ( ok == 0 )
  22. cout << "NU EXISTA";
  23.  
  24. return 0;
  25. }
  26. void citgr()
  27. {
  28. cin >> n >> m;
  29. int x, y;
  30. for ( i = 1; i <= m; i++ )
  31. {
  32. cin >> x >> y;
  33. a[x][y] = 1;
  34. }
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement