Advertisement
STANAANDREY

sterg_linie

May 13th, 2019
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.  
  6. int n,i,j,a[100][100],k,m;
  7. cout<<"n=";cin>>n;
  8. cout<<"m=";cin>>m;
  9. cout<<"k=";cin>>k;
  10. for (i=0;i<n;i++)
  11.     for (j=0;j<m;j++)
  12.      cin>>a[i][j];
  13.  
  14. for (i=k;i<n-1;i++)
  15.     for (j=0;j<m;j++)
  16.     a[i][j]=a[i+1][j];
  17. n--;
  18. cout<<endl<<"matricea noua:"<<endl;
  19.  
  20. for (i=0;i<n;i++) {
  21.     for (j=0;j<m;j++)
  22. cout<<a[i][j]<<' ';
  23. cout<<endl;
  24. }
  25.   return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement