Re: [問題] 九九乘法表

看板C_Sharp作者 (逍遙遊)時間12年前 (2012/05/05 01:37), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串4/4 (看更多)
這次我改用 while 迴圈...讓你看看有多複雜... 我現在已經安裝試用版,測試可用...^_^ int x = 1; int y = 1; string str; Console.Write(" "); while(x < 10) { str = Convert.ToString(x); Console.Write(str.PadLeft(3)); x++; } Console.Write("\n"); while(y < 10) { Console.Write(y); x = 1; while(x < 10) { str = Convert.ToString(x * y); Console.Write(str.PadLeft(3)); x++; } Console.Write("\n"); y++; } Console.ReadLine(); -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.25.181.174
文章代碼(AID): #1Ff1FJXG (C_Sharp)
文章代碼(AID): #1Ff1FJXG (C_Sharp)