#include<iostream>
using namespace std;
int main()
{
int n=0,m=0; // 2D array nRow, nCol
int a[n][m];
int i,j; // цикъл въвеждане 2D
int q,p,t; // for 2D=>1D
int b[100];
int r; // for cout
cout<<"Enter the array's number of rows and columns: ";
cin>>n>>m;
// entering values for the 2D array
for (i = 0;i<=n;i++)
{
for (j = 0;j<=m;j++)
{
cout<<"a["<<i<<"]["<<j<<"]="<<endl;
cin>>a[i][j];
cin.ignore();
}
}
// Most likely the failzone IMO
for (q = 0;q<=i;q++)
{
for (t = 0;t<=i*j+j;t++)
{
b[t] = a[i][j];
}
}
// attempting to print the 1D values
cout<<"The values in the array are"<<"\n";
for(r=0;r<=t;r++)
{
cout<<"b["<<r<<"] = "<<b[r]<<endl;
}
cin.get();
return 0;
}
I2luY2x1ZGU8aW9zdHJlYW0+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpCnsKCiAgICBpbnQgbj0wLG09MDsgLy8gMkQgYXJyYXkgblJvdywgbkNvbAogICAgaW50IGFbbl1bbV07CiAgICBpbnQgaSxqOyAvLyDRhtC40LrRitC7INCy0YrQstC10LbQtNCw0L3QtSAyRAogICAgaW50IHEscCx0OyAvLyBmb3IgMkQ9PjFECiAgICBpbnQgYlsxMDBdOwogICAgaW50IHI7IC8vIGZvciBjb3V0CiAgICBjb3V0PDwiRW50ZXIgdGhlIGFycmF5J3MgbnVtYmVyIG9mIHJvd3MgYW5kIGNvbHVtbnM6ICI7CiAgICBjaW4+Pm4+Pm07CgogICAgLy8gZW50ZXJpbmcgdmFsdWVzIGZvciB0aGUgMkQgYXJyYXkKICAgICAgICBmb3IgKGkgPSAwO2k8PW47aSsrKQogICAgICAgIHsKICAgICAgICAgICAgZm9yIChqID0gMDtqPD1tO2orKykKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgY291dDw8ImFbIjw8aTw8Il1bIjw8ajw8Il09Ijw8ZW5kbDsKICAgICAgICAgICAgICAgIGNpbj4+YVtpXVtqXTsKICAgICAgICAgICAgICAgIGNpbi5pZ25vcmUoKTsKCgogICAgICAgICAgICB9CiAgICAgICAgfQoKICAgIC8vIE1vc3QgbGlrZWx5IHRoZSBmYWlsem9uZSBJTU8KICAgZm9yIChxID0gMDtxPD1pO3ErKykKICAgICAgICB7CiAgICAgICAgICAgIGZvciAodCA9IDA7dDw9aSpqK2o7dCsrKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBiW3RdID0gYVtpXVtqXTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgIC8vIGF0dGVtcHRpbmcgdG8gcHJpbnQgdGhlIDFEIHZhbHVlcwogICAgY291dDw8IlRoZSB2YWx1ZXMgaW4gdGhlIGFycmF5IGFyZSI8PCJcbiI7CiAgICBmb3Iocj0wO3I8PXQ7cisrKQogICAgICAgIHsKICAgICAgICAgICAgY291dDw8ImJbIjw8cjw8Il0gPSAiPDxiW3JdPDxlbmRsOwogICAgICAgIH0KCmNpbi5nZXQoKTsKcmV0dXJuIDA7Cn0K