[C#基礎]-C#實做九九乘法表
本篇要分享C#實做C#實做九九乘法表範例,有興趣的同好,歡迎來一下哈哈 ^ ^。
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;
namespace Console_Multiplication_Table { class Program { static void Pause() { Console.Write("Press any key to continue . . . "); Console.ReadKey(true); } static void Main(string[] args) { int[,] A; A = new int[2, 9]; int i,j; for (i = 1; i < 10; i++) { A[0, i - 1] = i; A[1, i - 1] = i; } for (i = 0; i < 9; i++) { for (j = 0; j < 9; j++) { Console.Write(A[0, i] + "X" + A[1, j] + "=" + (A[0, i] * A[1, j])+" "); } Console.WriteLine(); } Pause(); } } }
|
沒有留言:
張貼留言