14th Week Project One (2)--toss a two-dimensional array

Source: Internet
Author: User

/* Copyright (c) 2014, Yantai University School of Computer * All rights reserved. * File name: Test.cpp * Chen Dani * Completion date: November 30, 2014 * Version number: v1.0 * * Problem Description: No * Input Description: Enter some        Integer * Program output: Output two-dimensional array */#include <iostream>using namespace Std;int main () {int i,j;        Creates a two-dimensional integer array of 5 rows and 4 columns, assigning the initial value int a[5][4]={{0,1},{4,5},{8,9},{12,13},{16,17} to the 10 elements in the first two columns of the array;    The keyboard input causes the value of the latter two columns 10 elements cout<< "Please enter 10 integers:" <<endl;    for (i=0;i<5;i++) for (j=2;j<4;j++) cin>>a[i][j];    The number in the cout<< "array by row order precedence output is:" <<endl;        for (i=0;i<5;i++) {cout<< "<<i<<" line: ";        for (j=0;j<4;j++) cout<<a[i][j]<< ' \ t ';    cout<<endl; } cout<< "Now multiply all elements by 3 times times ... Complete!    "<<endl;    cout<< "line order Priority output:" <<endl;        for (i=0;i<5;i++) {cout<< "<<i<<" line: ";        for (j=0;j<4;j++) cout<<3*a[i][j]<< ' \ t '; Cout<<endl; } return 0;}

14th Week Project One (2)--toss a two-dimensional array

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.