Advertisement
rotti321

identice_2 cu comm

Feb 28th, 2022
51
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6. int a[101][101],n,m,c=0;
  7. cin>>n>>m;
  8. for(int i=1;i<=n;i++)
  9. for(int j=1;j<=m;j++)
  10. cin>>a[i][j];
  11.  
  12. for(int i=1;i<n;i++) ///fixam linia i
  13. for(int is=i+1;is<=n;is++){ //comparam toate liniile din partea de jos a lui i (de la i+1 pana la n)
  14. int ok=1;
  15. for(int j=1;j<=m;j++) ///parcurgem in pararel cele doua linii
  16. {
  17. if(a[i][j]!=a[is][j])
  18. ok=0;
  19. }
  20. if(ok==1)
  21. c++;
  22. }
  23. cout<<c;
  24. return 0;
  25. }
Advertisement
RAW Paste Data Copied
Advertisement