Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 2.Sa se elimine din matrice:
- a)Liinile pentru care primul elementare suma cifrelor divizibila cu 0.
- b)Coloanele pe care se afla elementul minim din matrice.
- #include<iostream>
- using namespace std;
- int main()
- {int a[100][100],i,j,n,m,s,c,x;
- cout<<"n=";cin>>n;
- cout<<"m=";cin>>m;
- for(i=0;i<n;i++)
- for(j=0;j<m;j++)
- {cout<<"a["<<i<<"]["<<j<<"]=";
- cin>>a[i][j];
- }
- for(i=0;i<n;i++)
- {
- s=0;
- x=[a][0];
- while(x!=0)
- {
- s=s+x%10;
- x=x/10;
- }
- for(c=i;c<n-1;c++)
- for(j=0;j<m;j++)
- n--;
- }}
- cout<<endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement