void main()
{
int row, col;
cout << "Please enter the number for row and column: " << endl;
cin >> row >>col;
//为二维数组开辟空间
int **Result = new int*[row];
for (int i = 0; i < row; i++)
{
Result[i] = new int[col];
}
ifstream fin("./data.txt");
for (int i = 0; i != row; ++i) {
for (int j = 0; j != col; ++j) {
fin >> Result[i][j];
}
}
fin.close();
for (int w=0;w<row;w++)
{
for (int r=0;r<col;r++)
{
if(r<=w)
cout<<0<<",";
else
cout<<Result[w][r]<<",";
}
cout<<endl;
}
//释放二维数组占用的空间
for (int m = 0; m < row; m++)
{
delete[] Result[m];
}
delete[] Result;
Result = NULL;
//system("pause");
return;
}