#include #include #include #include void main() { float attribute[32],pe[4][4][2]; int nx=4,ny=4,nz=2; int nnp=32; int i,j,k; int ind1,ind2,ind; //*********** read the data from the file attribute*/ ifstream fin; fin.open("attribute.dat"); for(int t=1;t<=nnp;t++) { fin>>attribute[t]; } fin.close(); //*********************************************** for(k=1;k<=nz;k++) { ind1=(k-1)*(nx*ny); for(j=1;j<=ny;j++) { ind2=(j-1)*(nx); for(i=1;i<=nx;i++) { ind=i+ind2+ind1; pe[i][j][k]=attribute[ind]; } } } ofstream fout; fout.open("pe.dat"); for(k=1;k<=nz;k++) { for(j=1;j<=ny;j++) { for(i=1;i<=nx;i++) { fout<