Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int i,n,m,x,y,a[100][100]{0},max1=0,sum,j,poz;
  8. cin>>n>>m;
  9. for(i=1;i<=m;i++)
  10. {cin>>x>>y;
  11. a[x][y]=1; a[x][y]=1;}
  12. for(i=1;i<=n; i++)
  13. sum=0;
  14. for(j=1;j<=n; j++)
  15. if(a[i][j]==1)
  16. sum++;
  17. if(sum>max1)
  18. {
  19. poz=1;
  20. max1=sum;
  21. }
  22. cout<<poz;
  23. return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement