qfedu-basic-level/day8/d9.cpp

29 lines
509 B
C++
Raw Permalink Normal View History

2023-06-23 17:31:07 +08:00
#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;
}