Questions and codes
/* Copyright (c) 2014, Yantai University School of Computer * All rights reserved. * File name: Test.cpp *: Simbin * Completion Date: November 27, 2014 * Version number: v1.0 * * Problem Description: First output array elements by row order. * Input Description: The latter two column elements. * Program output: array element; */#include <iostream>using namespace Std;int main () { int i,x,y; int a[5][4]= {{0,1},{4,5},{8,9},{12,13},{16,17}}; cout<< "Please enter 10 integers:" <<endl; for (x=0; x<5; x + +) for (y=2; y<4; y++) cin>>a[x][y]; The value in the cout<< "array is:" <<endl; for (x=0; x<5; x + +) { cout<< "" <<x<< "line:"; for (y=0; y<4; y++) cout<<a[x][y]<< " "; cout<<endl; } return 0;}
Operation Result:,
Learning sentiment: Why the teacher can row so neat .....
The 14th week on the Machine practice project of the two-dimensional array (1)