Example: Use two-dimensional array to calculate the total score, list the score table.

Source: Internet
Author: User

  while(true)            {                Double[,] a =New Double[3,4];//defines a two-bit array of three rows and four columns                 for(inti =0; I <3; i++)//loop out three results for each person{a[i,0] = i +1;//Show School NumberConsole.Write ("Please enter section"+ (i+1)+"individual's language scores:"); A[i,1] = convert.todouble (Console. ReadLine ());//Input language scoresConsole.Write ("Please enter section"+ (i+1)+"Individual Math results:"); A[i,2] = convert.todouble (Console. ReadLine ());//Enter Math scoresA[i,3] = A[i,1] + a[i,2];//figure out the total score} Console.WriteLine ("The end result is:"); Console.WriteLine ("School Number"+"\ t"+"language"+"\ t"+"Mathematics"+"\ t"+"Total");  for(inti =0; I <3; i++)//output Three rows four columns                {                     for(intj =0; J <4; J + +) {Console.Write (A[i,j]+"       ");            } console.readline (); }                }

Example: Use two-dimensional array to calculate the total score, list the score table.

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.