tanasaradu

Untitled

Nov 23rd, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int n,m,a[1005][1005],p,q;
  4. int main()
  5. {
  6. int x;
  7. cin>>p>>q;
  8. n=1;
  9. for(int i=1; i<=p; i++)
  10. {
  11. m=1;
  12. for(int j=1; j<=q; j++)
  13. {
  14. cin>>x;
  15. if(i!=(p-1) && j!=(q-1))
  16. a[n][m++]=x;
  17. }
  18. if(i!=p-1)
  19. n++;
  20. }
  21. n--;
  22. m--;
  23. for(int i=1; i<=n; i++)
  24. {
  25. for(int j=1; j<=m; j++)
  26. cout<<a[i][j]<<" ";
  27. cout<<"\n";
  28. }
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment