qfedu-basic-level/day8/d9.cpp

29 lines
509 B
C++

#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
int arr[3][5] = {
{1, 2, 3, 4, 5},
{10, 20, 30, 40, 50},
{100, 200, 300, 400, 500}};
cout << "第一行数据: ";
for (int i = 0; i < 5; i++)
{
cout << arr[0][i] << "\t";
}
cout << endl;
// 读取所有行的数据
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 5; j++)
cout << arr[i][j] << "\t";
cout << endl;
}
return 0;
}