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