Re: [問題] 請問要怎麼用C#寫九九乘法表

看板C_Sharp作者 (#_^)時間18年前 (2006/02/13 15:23), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
using System; namespace ConsoleApplication1 { class Class1 { [STAThread] static void Main(string[] args) { int i,j; for (i=1;i<=9;i++) { for (j=2;j<=9;j++) { if (j*i < 10) { Console.Write("{0}*{1}= {2} ",j,i,j*i); } else Console.Write("{0}*{1}={2} ",j,i,j*i); } Console.Write("\n"); } Console.ReadLine(); } } } 顯示結果 2*1=2 3*1=3 ...etc 2*2=4 2*3=6 ... .. .etc 我也在自學..純分享 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 163.29.129.66
文章代碼(AID): #13y3FvOE (C_Sharp)