fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void nhap(int a[][205], int n, int m){
  5. cout << "Nhập mảng : \n";
  6. for(int i = 0; i < n; i++){
  7. for(int j = 0; j < m; j++){
  8. cout << "a[" << i << "][" << j << "] = ";
  9. cin >> a[i][j];
  10. }
  11. }
  12. }
  13.  
  14. void xuat(int a[][205], int n, int m){
  15. cout << "Mảng 2 chiều : \n";
  16. for(int i = 0; i < n; i++){
  17. for(int j = 0; j < m; j++){
  18. cout << a[i][j] << " ";
  19. }
  20. cout << endl;
  21. }
  22. }
  23.  
  24. int main(){
  25. int n, m , a[205][205];
  26. cout << "Nhập số hàng, cột : ";
  27. cin >> n >> m;
  28. nhap(a, n, m);
  29. xuat(a, n, m);
  30. return 0;
  31. }
Success #stdin #stdout 0.01s 5308KB
stdin
Standard input is empty
stdout
Nhập số hàng, cột : Nhập mảng : 
Mảng 2 chiều :