fork download
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4. int main()
  5. {
  6. int m, n;
  7. cin>>m>>n;
  8. int arr[m][n];
  9. for(int i = 0; i<m; i++)
  10. {
  11. for(int j=0; j<n; j++)
  12. {
  13. cin>>arr[i][j];
  14. }
  15. }
  16. int x;
  17. cin>>x;
  18. for(int j=0; j<m; j++)
  19. {
  20. cout<<arr[j][x-1]<<endl;
  21. }
  22.  
  23.  
  24.  
  25. return 0;
  26. }
  27.  
Success #stdin #stdout 0s 5296KB
stdin
2 3
1 2 3
4 5 6
2
stdout
2
5