Java programming-51-multi-dimensional array exercises

Source: Internet
Author: User

Java programming those things 51-multi-dimensional array exercises Zhengzhou game college Chen yuefeng from: http://blog.csdn.net/mailbomb 6.7 array Comprehensive Exercises1. Calculate the product matrix C of two matrices A and B. Matrix A = {1, 2, 4, 5, 6}; matrix B = {7, 8, 9, 10, 11, 12 }. The product of the two matrices is still a matrix. If matrix A has m row p columns and matrix B has P row n columns, their product C matrix has m row n columns. C = a * B algorithm: CIJ = (I = 0, 1 ,......, M-1; j = ,......, N-1) let a, B, and C matrix be represented by three 2-dimensional arrays: array A has three rows and two columns, and array B has two rows and three columns, the C array has three rows and three columns. For example: c [0] [0] = A [0] [0] * B [0] [0] + A [0] [1] * B [1] [0]; c [1] [0] = A [1] [0] * B [0] [1] + A [1] [1] * B [1] [1]; 2. Calculate and output the nxn matrix. (N> 0) For example, the 4x4 snake matrix is as follows: 1 3 4 10 2 5 9 11 6 8 12 15 7 13 14 163, fill a 3x3 array with the 9 numbers 1-9, and output all possible situations. Note: I hope you will make some suggestions.

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.