3.44

来源:互联网 发布:淘宝图 编辑:程序博客网 时间:2024/06/02 02:14
#include<iostream>using int_array = int[4];using namespace std;int main(){int arr[3][4] ={{ 0, 1, 2, 3 },{ 4, 5, 6, 7 },{ 8, 9, 10, 11 }};for (const int(&row)[4] : arr)for (int col : row)cout << col << " ";cout << endl;for (size_t i = 0; i != 3; ++i)for (size_t j = 0; j != 4; j++)cout << arr[i][j] << " ";cout << endl;for (int_array *p = arr; p != arr + 3;++p)for (int *q = *p; q != *p + 4; ++q)cout << *q << " ";cout << endl;return 0;}

0 0