Advertisement
STANAANDREY

IMP:mut_col_continmin

May 15th, 2019
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int a[100][100],n,i,j,k,c,mini,m;
  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.     mini=a[0][0];
  12.     for (i=0;i<n;i++)
  13.     for (j=0;j<m;j++)
  14.      if (mini>a[i][j])
  15.      mini=a[i][j];
  16.     for (j=0;j<m;j++)
  17.     {
  18.         for (i=0;i<n;i++)
  19.         if (a[i][j]==mini)
  20.       {
  21.           for (i=0;i<n;i++)
  22.           for (c=j;c<m-1;c++)
  23.           a[i][c]=a[i][c+1];
  24.           m--;
  25.           j--;
  26.           break;
  27.       }
  28.     }
  29.  cout<<endl;
  30.     for (i=0;i<n;i++) {
  31.         for (j=0;j<m;j++)
  32.      cout<<a[i][j]<<' ';
  33.      cout<<endl;
  34.     }
  35.   return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement