- using ConsoleApp1;
- using System;//程式庫呼叫
- using System.ComponentModel.DataAnnotations;
- using System.Linq.Expressions;
- using ABC.qq;
- class Program//負責一部分工作的人
- {
- const string dreams = "There are moments in life when you miss someone so much that " +
- "you just want to pick them from your dreams and hug them for real! Dream what " +
- "you want to dream;go where you want to go;be what you want to be,because you have " +
- "only one life and one chance to do all the things you want to do";
- static void Main()//method ..Entry Point 程式進入點
- {
- try
- {
- int x1 = 0;
- x1=Convert.ToInt32(Console.ReadLine());
- if(x1>9)
- {
- throw new ArgumentException();
- }
- int k;
- for(int i=1;i<=x1;i++)
- {
- for(int j=i;j>=1;j--)
- {
- Console.Write("{0}*{1}={2,-4:00}",i,j,i*j);//寬度為4個字元,需靠左對齊。
- }
- Console.WriteLine();
- }
- }
- catch
- {
- Console.WriteLine("error");
- }
- }
- }
複製代碼 |