#include <vector>
#include <iostream>
using namespace std;
typedef double Slot;
typedef vector<Slot> Row;
typedef vector<Row> Table;
typedef Row::size_type RSize;
typedef Table::size_type TSize;
void foo(Row *tb, TSize m, RSize n)
{
for (TSize i = 0; i < m; i++)
{
for(RSize j = 0; j < n; j++)
{
cout << tb[i][j] << " ";
}
cout << endl;
}
}
int main()
{
Table tb;
for (int i = 0; i < 10; i++)
{
tb.push_back(Row(5, i));
}
foo(&tb[0], tb.size(), tb[0].size());
return 0;
}
I2luY2x1ZGUgPHZlY3Rvcj4KI2luY2x1ZGUgPGlvc3RyZWFtPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKdHlwZWRlZiBkb3VibGUgU2xvdDsKdHlwZWRlZiB2ZWN0b3I8U2xvdD4gUm93Owp0eXBlZGVmIHZlY3RvcjxSb3c+IFRhYmxlOwp0eXBlZGVmIFJvdzo6c2l6ZV90eXBlIFJTaXplOwp0eXBlZGVmIFRhYmxlOjpzaXplX3R5cGUgVFNpemU7Cgp2b2lkIGZvbyhSb3cgKnRiLCBUU2l6ZSBtLCBSU2l6ZSBuKQp7CiAgICBmb3IgKFRTaXplIGkgPSAwOyBpIDwgbTsgaSsrKQogICAgewogICAgICAgIGZvcihSU2l6ZSBqID0gMDsgaiA8IG47IGorKykKICAgICAgICB7CiAgICAgICAgICAgIGNvdXQgPDwgdGJbaV1bal0gPDwgIiAiOwogICAgICAgIH0KICAgICAgICBjb3V0IDw8IGVuZGw7CiAgICB9Cn0KCmludCBtYWluKCkKewogICAgVGFibGUgdGI7CiAgICBmb3IgKGludCBpID0gMDsgaSA8IDEwOyBpKyspCiAgICB7CiAgICAgICAgdGIucHVzaF9iYWNrKFJvdyg1LCBpKSk7CiAgICB9CiAgICBmb28oJnRiWzBdLCB0Yi5zaXplKCksIHRiWzBdLnNpemUoKSk7CiAgICByZXR1cm4gMDsKfQoK