#include<iostream>
using namespace std;
/*
二维数组定义的四种方式
1. 数据类型 数组名 [行数][列数];
2. 数据类型 数组名 [行数][列数] = {{data1,data2},{data3,data4}};
3. 数据类型 数组名 [行数][列数] = {data1,data2,data3,data4};
4. 数据类型 数组名 [][列数] = {data1,data2,data3,data4};
*/
int main(){
//二维数组定义方式
int arr[2][3] =
{
{1,2,3},
{4,5,6}
};
//外层循环打印行数,内层循环打印列数
for (int i = 0; i < 2; i++)
{
for (int j = 0; j < 3; j++){
cout << arr[i][j] <<" ";
}
cout << endl;
}
system("pause");
return 0;
}