• Source
    1. #include <iostream>
    2. using namespace std;
    3. double a[9][9],b[9][9];
    4. int i,j,k,l,m,n;
    5. int main() {
    6. cin >> m >>n;
    7. cout <<"m="<<m<<endl;
    8. cout <<"n="<<n<<endl;
    9.  
    10. for( i=0;i<m;i++)
    11. for(j=0;j<n;j++)
    12. cin >> a[i][j];
    13.  
    14. for( i=0;i<m;i++)
    15. {
    16. for(j=0;j<n;j++) cout << a[i][j]<<"\t";
    17. cout << endl;
    18. }
    19. return 0;
    20. }
    21. // input:
    22. // 3 4
    23. // 1 2 3 4
    24. // 5 6 7 8
    25. // 9 10 11 12
    26.