I have nothing to do with writing a 9-9 multiplication table. Getting started. Let's take a look ., Getting started with multiplication

Source: Internet
Author: User

I have nothing to do with writing a 9-9 multiplication table. Getting started. Let's take a look ., Getting started with multiplication

I have nothing to do with writing a 9-9 multiplication table. Getting started.

1 @ using WebApp_Mvc_Wg_Api.Controllers; 2 @ {3 ViewBag. Title = "jiujiu multiplication table"; 4 // Layout = "~ /Views/Shared/_ Layout. cshtml "; 5} 6 <style> 7. main {8 width: 1000px; 9 height: pixel PX; 10} 11 12. main li {13 float: left; 14 width: 100px; 15 list-style: none; 16} 17 </style> 18 View Code
1 using System; 2 using System. collections. generic; 3 using System. linq; 4 using System. web; 5 using System. web. mvc; 6 7 namespace WebApp_Mvc_Wg_Api.Controllers 8 {9 public class DemoController: Controller10 {11 // GET: Demo12 public ActionResult Index () 13 {14 return View (); 15} 16 public ActionResult chenfabiao () 17 {18 jiafabiao (); 19 20 List <string> list = new List <string> (); 21 for (int x = 1; x <= 9; x ++) 22 {23 for (int y = 1; y <= 9; y ++) 24 {25 string formula = y + "*" + x + "=" + (x * y); 26 formula = y> x? "Outputs": formula; 27 list. add (formula); 28} 29} 30 ViewData ["chenfabiao"] = list. toList (); 31 return View (ViewData ["chenfabiao"]); 32} 33 34 public ActionResult jiafabiao () 35 {36 List <string> list = new List <string> (); 37 for (int x = 1; x <= 9; x ++) 38 {39 for (int y = 1; y <= 9; y ++) 40 {41 string formula = y + "+" + x + "=" + (x + y); 42 formula = y> x? "Statement": formula; 43 list. add (formula); 44} 45} 46 ViewData ["jiafabiao"] = list. toList (); 47 return View (ViewData ["jiafabiao"]); 48} 49 50} 51}
Controllers Code

Page Structure

 

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.