#include <iostream>
using namespace std;
void Nhap(float **a, int n, int m){
for(int i=0; i<n; i++)
for (int j=0; j<m; j++){
cin>>(*(*(a+i)+j));
}
}
void Xuat(float **a, int n, int m){
for(int i=0; i<n; i++)
for (int j=0; j<m; j++){
cout<<*(*(a+i)+j)<<" ";
if(j==m-1) cout<<endl;
}
}
int main(){
int n,m;
cout<<"Nhap n va m: "<<endl;
cin>>n;
cin>>m;
float **p = new float*[n];
for (int i =0; i<n; i++){
p[i] = new float[m];
};
Nhap(p,n,m);
Xuat(p,n,m);
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.