Advertisement
AlexandruDu

2.Matrici

Jun 8th, 2019
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. 2.Sa se elimine din matrice:
  2. a)Liinile pentru care primul elementare suma cifrelor  divizibila cu 0.
  3. b)Coloanele pe care se afla elementul minim din matrice.
  4.  
  5. #include<iostream>
  6. using namespace std;
  7. int main()
  8. {int a[100][100],i,j,n,m,s,c,x;
  9.  cout<<"n=";cin>>n;
  10.  cout<<"m=";cin>>m;
  11.  
  12. for(i=0;i<n;i++)
  13. for(j=0;j<m;j++)
  14. {cout<<"a["<<i<<"]["<<j<<"]=";
  15.  cin>>a[i][j];
  16. }
  17.  for(i=0;i<n;i++)
  18. {
  19.  s=0;
  20.  x=[a][0];
  21.  while(x!=0)
  22. {
  23.  s=s+x%10;
  24.  x=x/10;
  25. }
  26.   for(c=i;c<n-1;c++)
  27.      for(j=0;j<m;j++)
  28.   n--;
  29. }}
  30. cout<<endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement