Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int a[100][100],n,m,i,j,S,x,c;
- cout<<"n=";cin>>n;
- cout<<"m=";cin>>m;
- for (i=0;i<n;i++)
- for (j=0;j<m;j++)
- cin>>a[i][j];
- for (i=0;i<n;i++)
- {
- S=0;
- x=a[i][0];
- while (x)
- {
- S+=x%10;
- x/=10;
- }
- if (S%10==0)
- {
- for (c=i;c<n-1;c++)
- for (j=0;j<m;j++)
- a[c][j]=a[c+1][j];
- n--;
- }//*/
- }
- cout<<endl;
- for (i=0;i<n;i++){
- for (j=0;j<m;j++)
- cout<<a[i][j]<<' ';
- cout<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement