#include using namespace std ; void print_array( int A[], int n ) { if (n < 1) { cout << "[ ]" << endl ; return ; } cout << "[" << A[0] ; for (int i=1; i < n ; i++) { cout << ", " << A[i] ; } cout << "]" << endl ; return ; } int main() { int A[] = { 0, 1, 2, 3, 4 } ; A[2] = 777 ; cout << "A = " ; print_array(A, 5) ; int B[3] ; B[0] = A[1] ; B[1] = A[2] ; B[2] = A[3] ; // B[1] = 2 ; cout << "B = " ; print_array(B,3) ; cout << "A = " ; print_array(A, 5) ; }