Advertisement
STANAANDREY

17/4/2019

Apr 17th, 2019
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. { int a[101][101],m,n,i,j,x,k=0;
  6. cout<<"n=";cin>>n;
  7. cout<<"m=";cin>>m;
  8. for( i=0;i<n;i++)
  9. for( j=0;j<m;j++)
  10. cin>>a[i][j];
  11. cout<<"x=";cin>>x;
  12. for (i=0;i<n;i++)
  13.  for (j=0;j<m;j++)
  14.      if (x==a[i][j])
  15.        k++;
  16.  cout<<x<<" apare de "<<k<<" ori in matrice!";
  17.    return 0; }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement